Quick question about PHP_AUTH_USER
Posted: Thu Sep 18, 2003 3:31 pm
I have a PHP file that contains the following
When loaded, it pops up the dialog box asking for username and password. As you can see, there isn't one. The script should let you in as long as you enter somthing. But this keeps popping up the box every time you click ok.
Any ideas? I have checked it with 2 browsers, and run it from 2 servers, and still the same problem.
Help
cheers - James
Code: Select all
<?php
if ((!isset( $PHP_AUTH_USER )) || (!isset($PHP_AUTH_PW))) {
header( 'WWW-Authenticate: Basic realm="Private"' );
header( 'HTTP/1.0 401 Unauthorized' );
echo 'Authorization Required.';
exit;
} else {
echo "You entered $PHP_AUTH_USER for a username.<BR>";
echo "You entered $PHP_AUTH_PW for a password.<BR>";
}
?>Any ideas? I have checked it with 2 browsers, and run it from 2 servers, and still the same problem.
Help
cheers - James