I've just started coding PHP and i've stumbled on a little problem.
I'm currently just coding a simple website Register/Login project. And i'm currently on to making a "Contact us" sub.
So heres the code, if anyone could help me whats wrong:
<?php
if (empty($name) === true || empty($email) === true || empty($message) === true) {
$errors[] = 'Name, email and message are required!';
} else {
}
// The else above is actually not needed thus you could remove it.
if (filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
$errors[] = 'That\'s not a valid email adress you have entered.';
}
}
if (ctype_alpha($name) === false) {
$errors[] = 'Name must only contain letters!'
if (empty($errors) === true);
}
?>