网站要求认证

时间:2013-01-02 05:56:02

标签: php authentication

当我访问网站网址时,我的网站要求进行身份验证。它说

"A username and password are being requested by http://test.com. The site says: "c100 Undetectable #18a: Restricted area" 

当我点击取消按钮时,它会消失。每当我刷新页面或点击链接时它都会询问..我该怎么做才能删除这个???

1 个答案:

答案 0 :(得分:5)

请在所有页面中检查此代码,并且此身份验证有一些标题,如下所示: -

if($_SERVER["PHP_AUTH_USER"]  && $_SERVER["PHP_AUTH_PW"]){

}        
header("WWW-Authenticate: Basic realm=);
header("HTTP/1.0 401 Unauthorized");

请删除此问题,您的问题将得到解决 要了解有关身份验证的详情,请参阅 - link