<?php
$redUser = "test";
$redPwd = "test";
if (($_SERVER['PHP_AUTH_USER'] != $redUser) || ($_SERVER['PHP_AUTH_PW'] != $redPwd))
{
Header("WWW-Authenticate: Basic realm=\"身份确认\"");
Header("HTTP/1.0 401 Unauthorized");
print("对不起!你没有权限!");
exit();
}
print("欢迎进入!");
?>