0

I have been wondering if there is a way of knowing if an email is signed up with your site using code (PHP). I am creating a password reset page and i want to check if the email is signed up with the site before proceeding to send an email for the password recovery. This is what i have so far...

<?php
include_once 'dbh.inc.php';

$email = mysqli_real_escape_string($conn, $_POST['email']);

//Error Handlers
//Check for empty fields
if (empty($email) {
    header("Location: ../pwdforgot.php?pwd=empty")
    exit();
} else {
    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
        header("Location: ../pwdforgot.php?pwd=email")
        exit();
    }
}

0 Answers0