views:

11

answers:

1

For some reason, none of the code within

if (isset($_SERVER['PHP_AUTH_USER']) &&
    isset($_SERVER['PHP_AUTH_PW']))

{



// When the above is set, the code that is here will execute of course

}

is being executed for me. When I enter the correct username and password, the prompt box for the authorization again pops up. Wouldn't both fields be 'set' if they are correct and I press enter? But for some reason that is not the case. What can I be doing wrong? Thank you.

A: 

Run phpinfo() and see under "Server API" item. if it's CGI/FCGI, there is no [sensible] way to use HTTP auth from PHP.

Col. Shrapnel
@Col. Shrapnel: it says CGI/FASTCGI
Newbie_25
@newbie-25 well just forget it. use your already installed per-directory one or session-based auth. or find yourself a mod_php installation
Col. Shrapnel