Home  >  Article  >  Backend Development  >  php我做的登陆页面,账户密码明明没错,但总显示错误,帮忙看一下谢谢!

php我做的登陆页面,账户密码明明没错,但总显示错误,帮忙看一下谢谢!

WBOY
WBOYOriginal
2016-06-02 11:32:142029browse

php

$_login=array();
if(isset($_POST['submit'])){
$_login['username']=_check_username($_POST['zh'],2,20);
$_login['password']=_check_password($_POST['mm'],6,18);
if(_fetch_array("SELECT * FROM userinfor WHERE username='{$_login['username']}' and password='{$_login['password']}'")){
header("Location:index.php");
}else{
echo "用户名错误或者密码错误";
}
}

两个函数
function _query($_sql){
if(!$result=mysql_query($_sql)){
exit('SQL执行失败');
}
return $result;
}
function _fetch_array($_sql){
return mysql_fetch_array(_query($_sql),MYSQL_ASSOC);
}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn