Home >Backend Development >PHP Tutorial >php制作登录页,登录跳转失败

php制作登录页,登录跳转失败

WBOY
WBOYOriginal
2016-06-23 13:08:591155browse

求大神看看哪里出问题了
include_once("functions/database.php");
$userName = null;
$password = null;
if(isset($_POST["userName"])){
$userName = $_POST["userName"];
}
if(isset($_POST["password"])){
$password = $_POST["password"];
}
$user_sql = "select * from user where name = '$userName' and password = '$password'";
get_Connection();
$result_user = mysql_query($user_sql);
$num_row = mysql_num_rows($result_user);
if($num_row > 0){
echo "登录成功";
}else{
echo "登录失败";
}                                      
?>

用户名和密码是直接sql添加的


回复讨论(解决方案)

试了很多次,然后突然可以了

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