NYCPHP Meetup

NYPHP.org

[nycphp-talk] .htaccess and php includes

Christopher R. Merlo cmerlo at ncc.edu
Fri Sep 26 10:17:02 EDT 2003


On 2003-09-26 06:57 -0700, David Vogel <davevgl at yahoo.com> wrote:

> No, I need to set up public and private versions of a telephone
> directory, and I was thinking that I might be able to branch my code to
> include either a file in the original public dir or one (that would
> display private fields) from a restricted dir.  Like I said, probably
> not the best way to do it, just a first idea that made me wonder if you
> can do this...

Dave:
My first thought reading that paragraph was a database table with as
many data fields as you need, and a password field.

if( $row[ 'password' ] != "" ) // if the password isn't empty
{
    // Authenticate a user
} else {
    // This is public information
}

Now you can use one select query, and just decide based on one field
of the table.  That's what I do.

-- 
  cmerlo at ncc.edu             http://turing.matcmp.ncc.edu/~cmerlo

It seems a little silly now, but this country was founded as a protest
against taxation.



More information about the talk mailing list