include($_SERVER['DOCUMENT_ROOT']."/inc_head.php");
print "
Thank You for Contacting Us
";
// shutting down page for now. resuming 2024-10-25 8:30am
//print "We were unable to send your message, please try again.";
//include($_SERVER['DOCUMENT_ROOT']."/inc_foot.php");
//exit;
// handle form
if($_POST['email'] or $_POST['phone']){
//$strTo = "scott.gerardi@gmail.com";
//$strTo = "gimp1973@gmail.com";
// remove @ symbols in every input field
foreach($_POST as $key => $val){
if ($key == 'email') $_POST[$key] = str_replace("@","[at]",$val);
else $_POST[$key] = str_replace("@"," ",$val);
}
$strTo = COMPANY_EMAIL;
$strSubject = "Feedback from ".COMPANY_DOMAIN_NAME;
$strMessage = "Feedback from ".COMPANY_DOMAIN_NAME."\n\n";
$strMessage .= "Name: ".$_POST['name']."\n";
$strMessage .= "Email: ".$_POST['email']."\n";
$strMessage .= "Phone: ".$_POST['phone']."\n";
$strMessage .= "Message: ".$_POST['message']."\n";
// Build POST request:
$recaptcha_url = 'https://www.google.com/recaptcha/api/siteverify';
$recaptcha_secret = '6Ldo698UAAAAAOWH6xLVddDwbmrJN9UWOBkvV9WI';
$recaptcha_response = $_POST['recaptcha_response'];
// Make and decode POST request:
$recaptcha = file_get_contents($recaptcha_url . '?secret=' . $recaptcha_secret . '&response=' . $recaptcha_response);
$recaptcha = json_decode($recaptcha);
//print "";
if ($recaptcha->score >= 0.5) {
// Verified - send email
$bSent = mail($strTo, $strSubject, $strMessage, "From: noreply@".COMPANY_DOMAIN_NAME."\r\n");
} else {
// Not verified - show form error
$bSent = false;
}
if($bSent){
// write to log
$strLog = COMPANY_NICKNAME."\n";
$strLog .= "Datetime: ".date('Y-m-d H:i:s')."\n";
$strLog .= "IP: ".$_SERVER['REMOTE_ADDR']."\n";
$strLog .= "Request URI: ".$_SERVER['REQUEST_URI']."\n";
$strLog .= "GET: ".serialize($_GET)."\n";
$strLog .= "POST: ".serialize($_POST)."\n\n";
@file_put_contents($_SERVER['DOCUMENT_ROOT']."/gl/log/contact-thanks-log.txt",$strLog,FILE_APPEND | LOCK_EX);
}
}
//don't tell them what's going on
print "We have received your message. A member of our staff will be in touch with you shortly.";
//if($bSent or $bSpam) print "We have received your message. A member of our staff will be in touch with you shortly.";
//else print "We were unable to send your message, please try again.";
include($_SERVER['DOCUMENT_ROOT']."/inc_foot.php");
?>