I'm trying to use HTTP 401 authorization variables and it doesn't seem to set the $_SERVER['PHP_AUTH_PW'] or $_SERVER['PHP_AUTH_USER'] variable.
Anyone have any ideas or would be willing to test whether this works on their server? Here is the code i'm using for authorizing a user and I've seen it work on another server:
Any help of anyone willing to see if it works on their server would be greatly appreciated.
Anyone have any ideas or would be willing to test whether this works on their server? Here is the code i'm using for authorizing a user and I've seen it work on another server:
PHP Code:
if ((!isset($_SERVER['PHP_AUTH_USER'])) || (!isset($_SERVER['PHP_AUTH_PW'])) || ($_SERVER['PHP_AUTH_USER'] != $user['name']) || ($_SERVER['PHP_AUTH_PW'] != $user['password'])) {
header('WWW-Authenticate: Basic realm="HostAuctionImages Login"');
header('HTTP/1.0 401 Unauthorized');
echo "You must enter a valid login ID and password to access this resource\n";
exit;
}
else {
return true;
}
Comment