We are very sorry, but there were error(s) found with the form you submitted“; echo “
“; echo “Please go back and correct these errors:
“; echo “
    “; echo $error; echo “
“; } function clean_string($string) { $bad = array(“content-type”,”bcc:”,”to:”,”cc:”,”href”); return str_replace($bad,””,$string); } // validation expected data exists if(!isset($feed_first) || # !isset($_POST[‘feed_last’]) || !isset($_POST[‘form_email’])) { died(‘We are sorry, but there appears to be a problem with the form you submitted.’); } $contact_url = “https://www.trapnfishmotel.com/contact/”; $realip = $_SERVER[‘REMOTE_ADDR’]; $iprefer = $_SERVER[‘HTTP_REFERER’]; $error_message = “”; $code2 = “28Xp53b”; if ($Code !== $code2) { $error_message .= ‘
  • You must enter the security code or the Code is incorrect: You entered ‘ . $Code . ‘. The correct code is ‘. $code2 .’ and the code is CASE Sensitive
  • ‘; } $string_exp = “/^[A-Za-z .’-]+$/”; if ($iprefer !== $contact_url) { $error_message .= ‘
  • You are trying to call this form from an unauthorized URL. How come?
  • ‘; } $string_exp = “/^[A-Za-z .’-]+$/”; if(!preg_match($string_exp,$feed_first)) { $error_message .= ‘
  • The first name you entered does not appear to be valid.
  • ‘; } if(!preg_match($string_exp,$feed_last)) { $error_message .= ‘
  • The last name you entered does not appear to be valid.
  • ‘; } //do nothing for phone as not required $email_exp = ‘/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/’; if(!preg_match($email_exp,$form_email)) { $error_message .= ‘
  • The email address you entered does not appear to be valid.
  • ‘; } if(strlen($error_message) > 0) { died($error_message); }else{ echo “

    Thank you for your inquiry

    “; echo “
    “; echo “We will be in touch with you very soon.
    “; echo “
    “; echo ““; echo ““; $email_message = “$email_subject \n”; $email_message .= “\n”; $email_message .= “************************************************************* \n”; $email_message .= “First name: “.clean_string($feed_first).”\n”; $email_message .= “Last name: “.clean_string($feed_last).”\n”; $email_message .= “Phone: “.clean_string($feed_phone).”\n”; $email_message .= “Email address: “.clean_string($form_email).”\n\n”; $email_message .= “Questions: “.clean_string($feed_comments).”\n\n”; $email_message .= “IP: “.$realip.”\n”; // create email headers $headers = ‘From: ‘.$femail.”\r\n”. ‘Reply-To: ‘.$form_email.”\r\n” . ‘X-Mailer: PHP/’ . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); } } ?>