return true; } else { return false; } } if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ClientIP = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ClientIP = $_SERVER['REMOTE_ADDR']; } $FTGname = DoStripSlashes($_REQUEST['name']); $FTGmob = DoStripSlashes($_REQUEST['mob']); $FTGemailid = DoStripSlashes($_REQUEST['emailid']); $FTGenquiry = DoStripSlashes($_REQUEST['enquiry']); $FTGbutton = DoStripSlashes($_REQUEST['button']); $FTGbutton2 = DoStripSlashes($_REQUEST['button2']); # Fields Validations $ValidationFailed = false; if (!check_email($FTGemailid, kMandatory)) { $ValidationFailed = true; } # Redirect user to the error page if ($ValidationFailed === true) { header("Location: index.html"); exit; } # Email to Form Owner $emailSubject = FilterCChars("IDEE Enquiry"); $emailBody = "name : {$FTGname}\n" . "mob : {$FTGmob}\n" . "emailid : {$FTGemailid}\n" . "enquiry : {$FTGenquiry}\n" . ""; $emailTo = '*****@*****.**'; $emailFrom = FilterCChars("{$FTGemailid}");
return true; } elseif (preg_match("/^([\\w\\!\\#\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\`{\\|\\}\\~]+\\.)*[\\w\\!\\#\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\`{\\|\\}\\~]+@((((([a-z0-9]{1}[a-z0-9\\-]{0,62}[a-z0-9]{1})|[a-z])\\.)+[a-z]{2,6})|(\\d{1,3}\\.){3}\\d{1,3}(\\:\\d{1,5})?)\$/i", $email) == 1) { return true; } else { return false; } } if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $clientIP = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $clientIP = $_SERVER['REMOTE_ADDR']; } $FTGfullname = DoStripSlashes($_POST['fullname']); $FTGemail = DoStripSlashes($_POST['email']); $FTGsubject = DoStripSlashes($_POST['subject']); $FTGmessage = DoStripSlashes($_POST['message']); $validationFailed = false; # Fields Validations if (!CheckEmail($FTGemail, kMandatory)) { $FTGErrorMessage['email'] = 'enter your email address properly'; $validationFailed = true; } # Include message in error page and dump it to the browser if ($validationFailed === true) { $errorPage = '<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><title>Error</title></head><body>Errors found: <!--VALIDATIONERROR--></body></html>'; $errorList = @implode("<br />\n", $FTGErrorMessage); $errorPage = str_replace('<!--VALIDATIONERROR-->', $errorList, $errorPage); echo $errorPage; } if ($validationFailed === false) { # Email to Form Owner
return true; } elseif (eregi("^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,4})\$", $email)) { return true; } else { return false; } } if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $clientIP = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $clientIP = $_SERVER['REMOTE_ADDR']; } $FTGname = DoStripSlashes($_REQUEST['name']); $FTGemail = DoStripSlashes($_REQUEST['email']); $FTGmessage = DoStripSlashes($_REQUEST['message']); $FTGsubmit = DoStripSlashes($_REQUEST['submit']); $validationFailed = false; # Fields Validations if (!CheckString($FTGname, 2, 0, kStringRangeFrom, kNo, kNo, kNo, '', kMandatory)) { $FTGErrorMessage['name'] = 'Please insert a valid name'; $validationFailed = true; } if (!CheckEmail($FTGemail, kMandatory)) { $FTGErrorMessage['email'] = 'Please insert a valid email address'; $validationFailed = true; } if (!CheckString($FTGmessage, 10, 0, kStringRangeFrom, kNo, kNo, kNo, '', kMandatory)) { $FTGErrorMessage['message'] = 'This field is required'; $validationFailed = true; } # Include message in error page and dump it to the browser
return true; } else { return false; } } if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $clientIP = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $clientIP = $_SERVER['REMOTE_ADDR']; } $FTGname = DoStripSlashes($_POST['name']); $FTGemail = DoStripSlashes($_POST['email2']); $FTGmessage = DoStripSlashes($_POST['message']); $FTGkeyword = DoStripSlashes($_POST['keyword']); $FTGsend = DoStripSlashes($_POST['send']); $FTGclear = DoStripSlashes($_POST['clear']); # # moakley # 2011/06/01 # Spammer hit the honeypot. Just send them on without emailing the webmaster. # if (!empty($_POST['email'])) { header("Location: contacts_submit.html"); } $validationFailed = false; # Fields Validations if (!CheckEmail($FTGemail, kMandatory)) { $FTGErrorMessage['email2'] = 'Please type in a valid email'; $validationFailed = true; } # Include message in error page and dump it to the browser