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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-02 11:32:14
Original
2091 people have browsed it

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);
}

Related labels:
php
Statement of this Website
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template