dragonpeng200811111 2018-06-16 17:39
浏览 101

警告:mysqli_query():第15行的C:\ xampp \ htdocs \ IT \ Adsware.com ecover.php中的空查询

What could be the cause of this? I want it to query the database and send the user message if the specified email exists in the database and flag error otherwise

<?php  
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    include 'includes/config.php';
    include 'includes/functions.php';
    $email = benny($_POST['email']);
    $from = "support@Adsware.com";
    $subject = "Password Reset";
    $msg = "Hello, you have requested to reset your password";
    $to = $email;
    if (empty($_POST['email'])) {
        echo "<script> alert(\"Please Enter your Email Address.\") </script> ";
    }else{
        $sql = "SELECT * FROM users WHERE email = $email";              
    }
    if (mysqli_query($con, $sql)) {
        if(mail($to, $subject, $msg)){
            echo "<script> alert(\"An Email with password reset link has been sent to your email inbox. Please Check it\") </script>";
        }else{
            echo "<script> alert(\"Email does not Exist\") </script>";
        }
    }else{
        echo "<script> alert(\"Error Encountered\") </script>";
    }
}
?>

<form name="recover" action="" method="POST" autocomplete="off">            
    <label>Username</label>
    <input type="email" name="email" placeholder="Enter Your Email">
    <input class="login-sub" type="submit" name="submit" value="Reset Password">
</form>
<a href="login.php"><button id="Login"> Login </button></a>

But it displays the error:

Warning: mysqli_query(): Empty query in C:\xampp\htdocs\IT\Adsware.comecover.php on line 15

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 关于大棚监测的pcb板设计
    • ¥15 stm32开发clion时遇到的编译问题
    • ¥15 lna设计 源简并电感型共源放大器
    • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)