I'm making now registration for my site. I have made validation.php file in which i have all functions that are validating my data. Email is validated like this:
if (filter_var($string, FILTER_VALIDATE_EMAIL) == false) {
$allChecked = false;
$_SESSION['emailError'] = "Your email has to be valid.";
}
But when i click on button (in registration form) when email is invalid (random letters) is gets through validation like the email is okay. So how i have to this so the email gets properly validated. Thanks for every answer
Try this code below.
It will allow good email but will prevent in valid email