Contact Us
If you have any questions or comments, simply fill out the form below (if you want reply back make sure you enter a valid email).
if($result == "verified"){ ?> =$message;?> }else{ ?> =$message;?> } ?>
// Check if form was submitted:
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['recaptcha_response'])) {
// Build POST request:
$recaptcha_url = 'https://www.google.com/recaptcha/api/siteverify';
$recaptcha_secret = '6Lc_EikaAAAAAMg01rxe62k3f1NZ31VeiAk94GVq';
$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);
// Take action based on the score returned:
if ($recaptcha->score < 0.5) {
echo "We are very sorry, but your Captcha score is too low.";
die();
}
}
$adminEmail = "infocuspub@gmail.com";
$domainUrlUpper = str_replace("www.","",$_SERVER['HTTP_HOST']);
//Email Injection Trap
foreach ($_POST as $j =>$value) {
if (stristr($value,"Content-Type")) {
header("HTTP/1.0 403 Forbidden");
exit;
}
}
$fromEmail = $_REQUEST['fromEmail'];
$comments = $_REQUEST['comments'];
$message = "";
if($_REQUEST['action'] == "submit"){
$message = "";
$result = "";
if($fromEmail != "" && $comments != "" ){
if(audit()){
$subject = "Contact Form (".$domainUrlUpper.")";
$mailBody = $comments;
send_mail($fromEmail, $subject, $mailBody);
$result = "verified";
$message = "Thank You! Your comments have been sent
";
}else{
$message = "Error: Your entered an Invalid Code
";
}
}else{
$message = "Error: Missing fields (all fields are required)
";
}
}
function send_mail($fromEmail, $subject, $mailBody){
global $adminEmail;
global $domainUrlUpper;
$headers = "To: ".$adminEmail."\r\n";
$headers .= "From: ".$domainUrlUpper."<".$fromEmail.">\r\n";
$headers .= "Reply-To: ".$fromEmail."\r\n";
mail($adminEmail, $subject, $mailBody, $headers);
}
function audit() {
session_start();
$digit = $_SESSION['digit'];
$userdigit = $_POST['userdigit'];
session_destroy();
if (($digit == $userdigit) && ($digit > 1)) {
return true;
} else {
return false;
}
}
?>
Contact UsIf you have any questions or comments, simply fill out the form below (if you want reply back make sure you enter a valid email). if($result == "verified"){ ?> =$message;?> }else{ ?> =$message;?> } ?> |