这段代码在我本机的apache下运行即可用,可我传到服务器上后就不好用了为什么呢?
<?
if ( $PHP_AUTH_USER <> "admin" Or $PHP_AUTH_PW <> "1234" ) {
header("WWW-Authenticate: Basic realm=\"Administration \"");
header("HTTP/1.0 401 Unauthorized");
echo "<script>alert(\"密码错误,无法管理!\");history.back();</script>";
exit;
}
?>