HTTP-Authentication and Windows
Posted: Tue Nov 19, 2002 2:07 pm
I have Apache and PHP installed on Windows XP Home.
I've been trying to do some basic http-authentication:
I'm sure that this should work correctly (I am not outputting anything before the header), however I always get a 500 Internal Server Error.
Will HTTP-Authentication work in Windows?
I've been trying to do some basic http-authentication:
Code: Select all
<?php
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;
}
else
{
echo "<p>You have entered this username: $PHP_AUTH_USER<br>";
echo "You have entered this password: $PHP_AUTH_PW<br>";
echo "The authorization type is: $PHP_AUTH_TYPE<p>";
}
?>Will HTTP-Authentication work in Windows?