I have looked at almost every post on this subject but im still having a problem:
$loginPage = "./zlogin.php?myAccount=Login";
if (!isset($PHP_AUTH_USER) || $unauthorized)
{
$realm = "MyPHPStore_".time();
Header("WWW-Authenticate: Basic realm=\"$realm\"");
Header("Status: HTTP/1.1 401 Unauthorized");
print "<h1>401 Unauthorized</h1>Unable to authorize you. Please <a href=\"$loginPage\">click here</a> to try again.";
exit;
}
I am getting error on the Header("Status:...
I have tried the following:
Header("HTTP/1.0 401 Unauthorized");
this just returns error.
Header("Status: Unauthorized");
this works but it just keeps throwing the screen up.
Header("Status: HTTP/1.0 401 Unauthorized");
I have this on another sever and it works fine. but on this server i'm trying i can't get it to work
Please help....