Can someone have a look at some code for me?
Here the problem. This is meant to delet an email address form a mysql table then alert the user this has been done. If the address does not exist then it alerts the user to that too.
But even if the address ddoes not exist it alerts the user that the address has been deleted!
Heres the code
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
if($r = mysql_query("DELETE FROM maillist WHERE email = '$mail'")){
echo '<script type="text/javascript"> alert("Email Address Has Been Deleted") </script>';
}
else {
echo '<script type="text/javascript"> alert("Email Does Not Exist In Database") </script>';
}
}
else {
echo '<script type="text/javascript"> alert("This Is Not A Valid Email Address!") </script>';
}
}
Thanks for looking...............