I can get VALIDATE to work, but SANITIZE is sending me crazy. I test it with an unacceptable email address but it enters the address into the database table warts and all. Please can you spot what I am doing wrong?
if (isset($POST['email'])) {
$etrim = trim($POST['email']);
}
if (filter_var($etrim, FILTER_SANITIZE_EMAIL)) {
$e = mysqli_real_escape_string($dbcon, $etrim);
}else{
$errors[] = 'You forgot to enter your email address.';
}