Вы можете добавить preg_match
для проверки, хотя это может пропустить второе условие, если условие одно работает. Это странно, но если добавить отдельно, это работает
// Check for an invalid e-mail. <-- Here is where I also want to add the check of .ac.uk at the end of the email
if ( !filter_var($email, FILTER_VALIDATE_EMAIL) && preg_match('/ac.uk$/', $email) ) {
header("Location: ../signup.php?error=invalidemail");
exit();
}
Этот будет работать
// Check for an invalid e-mail. <-- Here is where I also want to add the check of .ac.uk at the end of the email
if ( !filter_var($email, FILTER_VALIDATE_EMAIL)) {
header("Location: ../signup.php?error=invalidemail");
exit();
}
if (!preg_match('/ac.uk$/', $email)) {
header("Location: ../signup.php?error=invalidemail");
exit();
}