I need the user ID of the logged in user (.htaccess) on an Apache Server using PHP4. This should be in $REMOTE_USER or $PHP_AUTH_USER.
On one server (FreeBSD: Apache 1.3.27 with PHP 4.2.2) the test.phtml file below works as expected. The user login apprompt appears and the user logs in, and the page is displayed, with all variables HTTP_HOST, and REMOTER_USER, and PHP_AUTH_USER set as expected. On the other server (Windows XP: Apache 2.0.43 with PHP 4.3.1) the test.phtml file does not display values for any of the REMOTE_USER or PHP_AUTH_USER variables. The user login apprompt appears as expected and the user logs in, and the page is displayed, but only the HTTP_HOST value is set as expected. If phpinfo() is called, the user id does not show up in any of the variables displayed. As I set this server up myself, it is likely that something needs to be changed in the configuration files for Apache and/or PHP. Any ideas? Contents of test.phtml file: <html> <head><title>PHP Test</title></head> <body> <H1>PHP Test</H1> <?php echo "<BR>\$_SERVER[HTTP_HOST]="; echo $_SERVER["HTTP_HOST"]; echo "<BR>\$_SERVER[REMOTE_USER]="; echo $_SERVER["REMOTE_USER"]; echo "<BR>\$PHP_AUTH_USER="; echo $PHP_AUTH_USER; echo "<BR>\$REMOTE_USER="; echo $REMOTE_USER; echo "<BR>"; ?> </body></html> -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php