if (! isset ( $_SERVER ['PHP_AUTH_USER'] ) || ! isset ( $_SERVER ['PHP_AUTH_PW'] ) || $_SERVER ['PHP_AUTH_USER'] != 'admin' || $_SERVER ['PHP_AUTH_PW'] != '123456') {
header ( 'WWW-Authenticate: Basic realm="My Realm"' );
header ( 'HTTP/1.0 401 Unauthorized' );
echo '用户名或密码不正确';
exit ();
}