<?php 
 include '../config/index.php';

 include('../module/index.php');

 $db = new Database();
 $con = $db->connect();

 $user = new User($con);
 
 $post = filter_var_array($_POST,FILTER_SANITIZE_SPECIAL_CHARS);
 $email =  $post['email'];

if(!$user->emailExist($email)){
   $error = "Invalid Email address";
   echo $db->redirect('../../forgot-password.php?errors='.$error);
}else{
   $error = "An email notication has been sent to your email address";
   echo $user->sendRegForgot($email,null);
  echo $db->redirect('../../forgot-password.php?true='.$error);
}

?>