一个小程序,不知道为什么不好使!是不是还要有什么设置啊?
<?
if(!isset($php_auth_user))
{
header("WWW-Authenticate:basic realm=/"my realm/"");
header("http/1.0 401 unauthorized");
echo"text to send if user hits cancle button/n";
exit;
}
else
{
echo"hello $php_auth_user.<p>";
echo"you entered $php_auth_pw as your password.<p>";
}
?>
<?
if(!isset($php_auth_user))
{
header("WWW-Authenticate:basic realm=/"my realm/"");
header("http/1.0 401 unauthorized");
echo"text to send if user hits cancle button/n";
exit;
}
else
{
echo"hello $php_auth_user.<p>";
echo"you entered $php_auth_pw as your password.<p>";
}
?>
博主遇到一个PHP小程序不好使的问题,疑惑是否需要额外设置,并给出了一段PHP代码。代码中通过判断是否设置了$php_auth_user来进行不同处理,若未设置则进行身份验证,设置了则输出用户信息。
2734

被折叠的 条评论
为什么被折叠?



