Forum Moderators: coopster
I want users to login to the password protected subdirectory (let's say www.example.com/clients/) with the browser's default login dialog box, which is all automated by Apache and the web browser...
But once they are logged in, I want the target page (www.example.com/clients/index.php) to read the username that they logged in with and redirect them to a subdirectory with that name (www.example.com/clients/username/). Is there a way for PHP to read the username that they logged in with through Apache? Perhaps some kind of HTTP request that will return the username as a variable?
Thanks!
[edited by: eelixduppy at 9:11 pm (utc) on Aug. 22, 2007]
[edit reason] switched to example.com [/edit]
That information can be accessed via the $_SERVER [php.net] array with PHP_AUTH_USER and PHP_AUTH_PW.
Andrew
Yes PHP_AUTH_USER does only work with PHP as an Apache module, I have no idea what Bluehost use.
If you dump the $_SERVER and $_ENV arrays:
var_dump($_SERVER,$_ENV); Bluehost's config may be forwarding you the information via another variable, if your lucky! If not then I don't know I there's any other way of getting it. Andrew