未定义索引:甚至以为我使用过isset的密码

时间:2019-01-28 18:26:21

标签: php sql

请稍等一下,然后再提出这个问题,因为从我所看到的内容中,我尝试了大多数答案中显示的所有技术,但没有成功。拜托,我已经连续数天遇到这个错误,并尝试了所有尝试,让我们一起寻找解决方法!如果您需要任何其他代码或详细信息,请在评论中提问。谢谢

出现此错误:

enter image description here

这是我的login.php:

<?php

if (isset($_POST['email']) || isset($_POST['password']))
{   
    require_once 'connect.php';
    $email = $mysqli->escape_string($_POST['email']);
    $password = $mysqli->escape_string($_POST['password']);
    $result = $mysqli->query("SELECT * FROM users WHERE email='$email'");

    if ($result->num_rows == 0){
        echo "Did not find any user with this email.";
        exit();
    }
    else {
        $user = $result->fetch_assoc();
        //LINE 16//if (password_verify($password, $user['password'])){**
            $_SESSION['id'] = $user['id'];
            $_SESSION['email'] = $user['email'];
            echo "Success.";
        }else{
            echo "Wrong Password";
            die();
    }
}
} 

?>

这是我的login_page.php:

<?php require_once 'header.php' ?>

<center>
    <h1 class='pageTitle'>Login</h1>
    <a href="register_page.php" class='registerLink'> Or Register</a><br>
    <form action="login.php" method="post">
        <input type="text" name="email" placeholder="Email"> <br>
        <input type="password" name="password" placeholder="Password"><br>
        <input type="submit" value="Submit">
    </form>
</center>

<?php require_once 'footer.php' ?>

0 个答案:

没有答案