: <?php   //Set main variables for the data.   $fname = $lname = $email = $subject = $website = $likedsite = $findoption = $comments = "";    //Set the empty error variables.   $fnameErr = $lnameErr = $emailErr = $subjectErr = $commentsErr = $websiteErr = $findoptionErr = "";    //Check to see if the form was submitted.   if ($_SERVER["REQUEST_METHOD"] == "POST")   {     //Check the 'First Name' field.     if (empty($_POST["fname"]))     {       $fnameErr = "First Name is Required.";     }      else     {       $fname = validate_info($_POST["fname"]);     }      //Check the 'Last Name' field.     if (empty($_POST["lname"]))     {       $lnameErr = "Last Name is Required.";     }      else     {       $lname = validate_info($_POST["lname"]);     }      //Check the 'E-Mail' field.     if (empty($_POST["email"]))     {       $emailErr = "E-Mail is Required.";     }      else     {       $email = validate_info($_POST["email"]);       //Check if valid email.       if (!filter_var($email, FILTER_VALIDATE_EMAIL))       {         $emailErr = "Invalid E-Mail Format.";       }     }      //Check the 'Subject' field.     if (empty($_POST["subject"]))     {       $subjectErr = "Subject is Required.";     }      else     {       $subject = validate_info($_POST["subject"]);     }      //Check the 'Website' field.     if (empty($_POST["siteurl"]))     {       $website = "";     }      else     {       $website = validate_info($_POST["siteurl"]);       //Check if valid URL.       if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-0+&@#\/%?=~_|!:,.;]*[-a-z0-0+&@#\/%=~_|]/i",$website))       {         $websiteErr = "Invalid URL.";       }     }      //Check the 'How Did You Find Us' options.     if (empty($_POST["howfind"]))     {       $findoptionErr = "Please Pick One.";     }      else     {       $findoption = validate_info($_POST["howfind"]);     }      //Check the comment box.     if (empty($_POST["questioncomments"]))     {       $commentsErr = "Questions/Comments are Required.";     }      else     {       $comments = validate_info($_POST["questioncomments"]);     }      //Pass any un-required data.     $likedsite = validate_info($_POST["likedsite"]);   }    