Dear all,
I want to use this script at webpal.info. The popup coms up but I always go to Authentication failed. The login and password are fake just for testing I use my name. The login never passes.
Code:
<?
//-- login
if ($_SERVER["PHP_AUTH_USER"] != "erik" || $_SERVER["PHP_AUTH_PW"] != "smit")
{
header("WWW-Authenticate: Basic realm=\"Enter username and password to proceed\"");
header("HTTP/1.0 401 Unauthorized");
echo "<h1>Authentication failed</h1>You have no rights for this page.";
}
else
{
echo "This is what you see when the login and password are correct. ";
}
?>
Thanks for helping. I have a free account at webspace. Does this code fail because it is not supported? Is this a good way to protect (if it worsk)?