登陆类
时间:2006-03-21 来源:wangel_ing
文件:
login.rar
大小:
0KB
下载:
下载
Error:'.$error.'';
echo "返回";
}
//数据库连接
function dbconnect($server,$user,$pwd,$database)
{
@ $this->db = new mysqli($server,$user,$pwd,$database);
if(mysqli_connect_errno())
{
//$this->display($this->dberror);
return false;
}
return true;
}
//检查用户名密码是否正确
function avai_login($username,$userpwd)
{
$query = "select $this->password from $this->table where $this->username='$username'";
$correctpwd = $this->db->query($query);
$pwdrow = mysqli_fetch_array($correctpwd);
if($correctpwd->num_rows==0) //用户不存在
{
//$this->display($this->nameerror);
return false;
}
elseif(md5($userpwd)!=$pwdrow['password']) //密码错误
{
//$this->display($this->pwderror);
return false;
}
return true;
}
}
?>
相关阅读 更多 +