Code has been added to clipboard!

Validating PHP Email

Example
if (empty($_POST["name"])) {
  $name_error = "Nickname missing."; 
} else {
 $name = proc_input($_POST["name"]);
  // check if name doesn't contain unwanted characters
  if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
    $name_error = "Letters and spaces only.";
  } 
}