``` define('XXOO_USERNAME','Username'); //登录名称,自行修改 define('XXOO_PASSWORD','Password'); //登录密码,自行修改 if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_USER'] != XXOO_USERNAME ||$_SERVER['PHP_AUTH_PW'] != XXOO_PASSWORD) { Header("WWW-Authenticate: Basic realm=\"Website Login\""); Header("HTTP/1.0 401 Unauthorized"); echo <<<EOB <html><body> <h1>Rejected!</h1> <big>Wrong Username or Password!</big> </body></html> EOB; exit; } ```