每次我使用正确或不正确的电子邮件和密码登录时,我都在dashbord whz中登录

时间:2019-02-28 14:57:24

标签: php login syntax-error

为什么每次我使用每封电子邮件和密码登录仪表板时,我都使用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');
    }
}}

0 个答案:

没有答案