if(!isset($PHP_AUTH_USER))
{
Header("WWW-Authenticate: Basic realm=Please enter your username and password:");
Header("HTTP /1.0 401 Unauthorized");
echo "Authentication failed, you cannot access network resources! ";
exit;
}
else
{
if ($PHP_AUTH_USER!="username " or $PHP_AUTH_PW!="password")
{
Header("HTTP/1.0 401 Unauthorized");
echo "Authentication failed, you cannot access network resources!";
exit;
}
}
?>