Hi everyone,
I'm trying to het HTTP authentication working with the following code:
if (!isset($SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
echo 'Text to send if user hits Cancel button';
exit;
} else {
echo "<p>Hello {$SERVER['PHP_AUTH_USER']}.</p>";
echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>";
}
The box pops up but I always get the false message - it never returns true. Any ideas how to get it working?? I'm running PHP 4.3.3 on Apache 1.2 on Windows 2000.
many thanks!
Jason