htaccess and $PHP_AUTH_USER
| From: | Rene Fournier | Date: | Tue, 28 Aug 2001 19:24:27 +0000 |
| Subject: | htaccess and $PHP_AUTH_USER | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-64869@lists.php.net to get a copy of this message | ||
Please, someone, help me...
What I want to do: Have a user prompted for an ID/password, both of which
(if valid), get passed to a PHP script, which then uses the ID/password to
selectively display certain fields of a table. (For example, if the user
logs in as "Sales", he would only see the sales-related fields of the
tables. Whereas, if the user logs in as "Production", she would see the
production-related fields. Pretty simple.)
I've read the PHP docs on $PHP_AUTH_USER. One stupid question: Must I use
the htaccess directory-protection feature of Apache in order for this to
work (or is$PHP_AUTH_USER not dependent on Apache (or any web server) at
all)? I mean, from reading the docs, it seems as if the value stored in
$PHP_AUTH_USER comes what the user types into the Apache-spawned dialog box
(when the user types the URL containing that password-protected
directory.)?? The thing is, when I turn password protection on for the
directory in question, and add the users and passwords to the htaccess file,
then go to the URL in the browser, I get prompted several times for a user
and password--first, it seems, by Apache, then by the PHP code I copied from
the docs.
If anyone can help, I'd greatly appreciate it. Best would be some real code
running in a similar server environment. (The site in question is running
on www.fatcow.com servers--they're running PHP3 (shouldn't matter, right)
and Apache.)
MUCH thanks in advance...
...Rene
---
Rene Fournier,
PLEASErenefournierNO@yahooSPAM.com