Could someone tell me why this code isn’t catching non-alphabetical characters.
$firstname = check_input($_POST[‘firstname’], “Please enter your First Name”);
$firstname = ucwords($firstname);
if (!preg_match("/^[a-zA-Z ]*$/",$firstname)) {
show_error(“Name should have only alpha characters and white space”);
}
And why this code is forcing user to enter an address.
if (empty($_POST[“homeemail”])) {
$homeemail = “”;
} else {
$homeemail = check_input($_POST[‘homeemail’]);
/* If e-mail is not valid show error message */
if (!preg_match("/([\w-]+@[\w-]+.[\w-]+)/", $homeemail)) {
show_error(“Invalid personal e-mail address”);
}
Thank you