if(isset($account)&&isset($pass)) //判断用户是否输入完整
{
$query="select password,user_id from userinfo where username='$account'";
if(!$result=mysql_query($query,$connect))
{
header("Location:index.php"); //数据库错误,跳转
}
if(mysql_num_rows($result)) //查找到用户
{
$ps=mysql_fetch_row($result);
if(!strcmp($pass,$ps[0])) //判断密码
{
//通过验证
}
else
{
echo "self.location='index.php"; //验证失败
}
}
else
{
///无该用户
}
}
{
$query="select password,user_id from userinfo where username='$account'";
if(!$result=mysql_query($query,$connect))
{
header("Location:index.php"); //数据库错误,跳转
}
if(mysql_num_rows($result)) //查找到用户
{
$ps=mysql_fetch_row($result);
if(!strcmp($pass,$ps[0])) //判断密码
{
//通过验证
}
else
{
echo "self.location='index.php"; //验证失败
}
}
else
{
///无该用户
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货