If I am reading this right the php code is not there;
<?php
function ValidateEmail($email)
{
$pattern = '/^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i';
return preg_match($pattern, $email);
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['formid']) && $_POST['formid'] == 'contactusform1')
{
$mailto = '
information@bestofvacations.com';
$mailfrom = isset($_POST['email']) ? $_POST['email'] : $mailto;
$subject = 'General Information';
$message = 'Values submitted from web site form:';
$success_url = './EmailReceived.html';
$error_url = './EmailNotReceived.html';
$autoresponder_from = 'Best of vacations';
$autoresponder_to = isset($_POST['email']) ? $_POST['email'] : $mailfrom;
$autoresponder_subject = 'General Information';
$autoresponder_message = 'Thank you for reaching out to us. We have received your message and will respond to you shortly.
Please note; There could be a delay of 4-5 business days to respond to any requests.
Sincerely;
Best Of Vacations Admin Team';
$eol = "\n";
$error = '';
$internalfields = array ("submit", "reset", "send", "filesize", "formid", "captcha_code", "recaptcha_challenge_field", "recaptcha_response_field", "g-recaptcha-response");
$boundary = md5(uniqid(time()));
$header = 'From: '.$mailfrom.$eol;
$header .= 'Reply-To: '.$mailfrom.$eol;
$header .= 'MIME-Version: 1.0'.$eol;
$header .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'"'.$eol;
$header .= 'X-Mailer: PHP v'.phpversion().$eol;
try
{
if (!ValidateEmail($mailfrom))
{
$error .= "The specified email address is invalid!\n<br>";
throw new Exception($error);
}
$message .= $eol;
$message .= "IP Address : ";
$message .= $_SERVER['REMOTE_ADDR'];
$message .= $eol;
foreach ($_POST as $key => $value)
{
if (!in_array(strtolower($key), $internalfields))
{
if (!is_array($value))
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol;
}
else
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol;
}
}
}
$body = 'This is a multi-part message in MIME format.'.$eol.$eol;
$body .= '--'.$boundary.$eol;
$body .= 'Content-Type: text/plain; charset=ISO-8859-1'.$eol;
$body .= 'Content-Transfer-Encoding: 8bit'.$eol;
$body .= $eol.stripslashes($message).$eol;
if (!empty($_FILES))
{
foreach ($_FILES as $key => $value)
{
if ($_FILES[$key]['error'] == 0)
{
$body .= '--'.$boundary.$eol;
$body .= 'Content-Type: '.$_FILES[$key]['type'].'; name='.$_FILES[$key]['name'].$eol;
$body .= 'Content-Transfer-Encoding: base64'.$eol;
$body .= 'Content-Disposition: attachment; filename='.$_FILES[$key]['name'].$eol;
$body .= $eol.chunk_split(base64_encode(file_get_contents($_FILES[$key]['tmp_name']))).$eol;
}
}
}
$body .= '--'.$boundary.'--'.$eol;
if ($mailto != '')
{
mail($mailto, $subject, $body, $header);
}
if (!ValidateEmail($autoresponder_from))
{
$error .= "The specified autoresponder email address is invalid!\n<br>";
throw new Exception($error);
}
$autoresponder_header = 'From: '.$autoresponder_from.$eol;
$autoresponder_header .= 'Reply-To: '.$autoresponder_from.$eol;
$autoresponder_header .= 'MIME-Version: 1.0'.$eol;
$autoresponder_header .= 'Content-Type: text/plain; charset=ISO-8859-1'.$eol;
$autoresponder_header .= 'Content-Transfer-Encoding: 8bit'.$eol;
$autoresponder_header .= 'X-Mailer: PHP v'.phpversion().$eol;
mail($autoresponder_to, $autoresponder_subject, $autoresponder_message, $autoresponder_header);
header('Location: '.$success_url);
}
catch (Exception $e)
{
$errorcode = file_get_contents($error_url);
$replace = "##error##";
$errorcode = str_replace($replace, $e->getMessage(), $errorcode);
echo $errorcode;
}
exit;
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Contact Us</title>
<meta name="author" content="best of vacations">
<meta name="categories" content="travel">
<meta name="robots" content="index, nofollow">
<meta name="generator" content="
https://bestofvacations.com">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="favicon.ico" rel="shortcut icon" type="image/x-icon">
<link href="bettervacations_travelsite.css" rel="stylesheet">
<link href="Contact.css" rel="stylesheet">
<script>
function Validatecontactus()
{
var regexp;
var ContactnameEditbox4 = document.getElementById('ContactnameEditbox4');
if (!(ContactnameEditbox4.disabled || ContactnameEditbox4.style.display === 'none' || ContactnameEditbox4.style.visibility === 'hidden'))
{
regexp = /^[A-Za-zÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ]*$/;
if (!regexp.test(ContactnameEditbox4.value))
{
alert("Name required");
ContactnameEditbox4.focus();
return false;
}
if (ContactnameEditbox4.value == "")
{
alert("Name required");
ContactnameEditbox4.focus();
return false;
}
}
var ContactemailEditbox5 = document.getElementById('ContactemailEditbox5');
if (!(ContactemailEditbox5.disabled || ContactemailEditbox5.style.display === 'none' || ContactemailEditbox5.style.visibility === 'hidden'))
{
regexp = /^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i;
if (!regexp.test(ContactemailEditbox5.value))
{
alert("Valid email required");
ContactemailEditbox5.focus();
return false;
}
if (ContactemailEditbox5.value == "")
{
alert("Valid email required");
ContactemailEditbox5.focus();
return false;
}
}
var ContactsubjectEditbox6 = document.getElementById('ContactsubjectEditbox6');
if (!(ContactsubjectEditbox6.disabled || ContactsubjectEditbox6.style.display === 'none' || ContactsubjectEditbox6.style.visibility === 'hidden'))
{
regexp = /^[A-Za-zÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ]*$/;
if (!regexp.test(ContactsubjectEditbox6.value))
{
alert("Subject required");
ContactsubjectEditbox6.focus();
return false;
}
if (ContactsubjectEditbox6.value == "")
{
alert("Subject required");
ContactsubjectEditbox6.focus();
return false;
}
}
var ContactmessageTextArea1 = document.getElementById('ContactmessageTextArea1');
if (!(ContactmessageTextArea1.disabled || ContactmessageTextArea1.style.display === 'none' || ContactmessageTextArea1.style.visibility === 'hidden'))
{
if (ContactmessageTextArea1.value == "")
{
alert("Valid message required");
ContactmessageTextArea1.focus();
return false;
}
}
return true;
}
</script>
</head>
<body>
<div id="wb_ContactLayoutGrid1">
<div id="ContactLayoutGrid1">
<div class="col-1">
<div id="wb_ContactText1">
<span id="wb_uid0"><strong>How May We Help You</strong></span>
</div>
<div id="wb_ContactText2">
<span id="wb_uid1"><strong>Thank you for reaching out to us, we value any suggestions you may have.<br>We will reply to any concerns or requests shortly.</strong></span>
</div>
</div>
</div>
</div>
<div id="ContactLayer1">
<div id="ContactLayer1_Container">
<div id="wb_ContactUsForm1">
<form name="contactus" method="post" action="<?php echo basename(__FILE__); ?>" enctype="multipart/form-data" id="ContactUsForm1" onsubmit="return Validatecontactus()">
<input type="hidden" name="formid" value="contactusform1">
<label for="ContactnameEditbox4" id="ContactnameLabel4">Name</label>
<input type="text" id="ContactnameEditbox4" name="name" value="" autocomplete="off" spellcheck="false">
<label for="ContactemailEditbox5" id="ContactemailLabel6">Email</label>
<input type="text" id="ContactemailEditbox5" name="email" value="" spellcheck="false">
<label for="ContactsubjectEditbox6" id="ContactsubjectLabel7">Subject</label>
<input type="text" id="ContactsubjectEditbox6" name="Contact-UsEditbox6" value="" spellcheck="false">
<label for="" id="ContactmessageLabel8">Message</label>
<input type="submit" id="ContactsendButton1" name="" value="Send">
<textarea name="ContactUsTextArea1" id="ContactmessageTextArea1" rows="12" cols="126" spellcheck="false"></textarea>
</form>
</div>
</div>
</div>
</body>
</html>