Hey, I'm using the following code in a page to password protect it. Through my eyes, the code is correct but when I type in the correct info in my browser's pop-up box, it doesn't seem to let me in. I type in the info three times before it echo's Authorization Required!.
The login and password are in the config.php file and I did double check to see if I'm typing in the right characters.
<?php
include (dirname(__FILE__) . "/config.php");
func_mysqlconnect();
$auth = 0;
if (($PHP_AUTH_USER == $login ) && ($PHP_AUTH_PW == $password )) $auth = 1;
if ( $auth != 1 ) {
header( 'WWW-Authenticate: Basic realm="Authorization Required!"' );
header( 'HTTP/1.0 401 Unauthorized' );
echo 'Authorization Required!';
exit;
}
?>
Is there something missing or doing something wrong?
Thanks.