powerkylin
(powerkylin)
注册会员

一般会员
UID 27714
精华
0
积分 85
帖子 74
金钱 85 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2004-4-11
状态 离线
|
用这种用户认证方式安全么?
if ( !defined('IN_SHRIK') )
{
die(" Hacking attempt");
exit;
}
$error401="index.php";
$phpauthpw=$_SERVER['PHP_AUTH_PW'];
$phpauthuser=$_SERVER['PHP_AUTH_USER'];
if ($phpauthpw=="")
{
Header("WWW-Authenticate: Basic realm=\"join\"");
Header("HTTP/1.0 401 Unauthorized");
exit;
}
else
{
$user="select PASSWORD,enable from memberauth where username='$phpauthuser'";
$w_select->sql_query($user);
$row=mysql_fetch_array($w_select->$data);
$Authpass=$row[0];
$Authen=$row[1];
if (Authen=='0')
{
echo "您的帐号已经停用了";
exit;
}
if ($phpauthpw!==$Authpass)
{
Header("WWW-Authenticate: Basic realm=\"join\"");
Header("HTTP/1.0 401 Unauthorized");
exit;
}
}
|
|