Heim > Artikel > Backend-Entwicklung > php制作登录页,登录跳转失败
求大神看看哪里出问题了
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添加的
试了很多次,然后突然可以了