Trying to get a very simple authentication script to run (script below).
It does run and the authentication box appears but then regardless of what you type in it just sends you straight to a blank website saying "authorization required" and doesn't retain any PHP_AUTH_ variables.
In Safari it continually brings up the box to type in a UN & PWD again, and again, and again, and pressing cancel brings up a blank page.
Is this not supported in PHP under Mac OS X????
if (!isset( $PHP_AUTH_USER )) {
// If empty, send header causing dialog box to appear
header('WWW-Authenticate: Basic realm="My Private Stuff"');
header('HTTP/1.0 401 Unauthorized');
echo "Authorization Required.";
exit;
}
// If not empty, display values for variables
else {
echo "
<P>You have entered this username: $PHP_AUTH_USER <br>
You have entered this password: $PHP_AUTH_PW <br>
The authorization type is: $PHP_AUTH_TYPE</p>
";
}