Hi,
I'm a semi-newbie trying to create a "closed forum" using a .htaccess file and php3 on an apache server. The .htaccess file seems to be working fine, when I enter correct username and password, I can access the scripts in the restricted folder. I don't send any headers or anything, all I'm using is the .htaccess file. However, I'm unable to retrieve the username that was used in this process - the $PHP_AUTH_USER variable seems to be empty! Why?

The code I'm testing is this:

<?php
echo "Hello $PHP_AUTH_USER.<br>\n";
echo "You entered $PHP_AUTH_PW as your password.\n";
?>

Which produces this output:

Hello .
You entered as your password.

    either your running php as a cgi or since mod_auth? is forcing the authentication its removing those two variable.

      a year later

      it's called after you login, for example:
      echo $REMOTE_USER

        Write a Reply...