为什么每次我使用每封电子邮件和密码登录仪表板时,我都使用myslq数据库2进行连接,并且所有表单都正确无误,但是我仍然不知道为什么这不使日志记录正确
<?php include 'dbconnect.php';?>
<?php
function login(){
global $dblocalhost;
$button = filter_input(INPUT_POST,'click');
if(isset($button)){
$mail = filter_input(INPUT_POST,'email');
$pass = filter_input(INPUT_POST,'pass');
$email = mysql_real_escape_string($dblocalhost,$mail);
$password = mysql_real_escape_string($dblocalhost,$pass);
$queri = "SELECT * FROM user-data WHERE email ='$email'" or die("error query");
if(!$queri){
die('nope'.mysqli_error($queri));
}
$output = mysqli_query($dblocalhost,$queri);
while($check = mysqli_fetch_array($output)){
$user = $check['email'];
$userpass = $check['password'];
}
if ($email == $user && $password == $userpass){
$_SESSION['email'] = $user;
$_SESSION['password']= $userpass;
header("Location: dashbo.php");
exit();
} else {
header('Location: login.php?error');
}
}}