session_start(); include_once("classes/news.class.php"); include_once("classes/paginator.class.php"); include_once("classes/commonDB.class.php"); include_once("config.php"); include_once("connect.php"); $your_email ='firstlook@go-jamaica.com'; $errors = ''; $name = ''; $visitor_email = ''; $user_message = ''; if(isset($_POST['submit'])) { $name = $_POST['name']; $visitor_email = $_POST['email']; $user_message = $_POST['message']; ///------------Do Validations------------- if(empty($name)||empty($visitor_email)) { $errors .= "\n Name and Email are required fields. "; } if(IsInjected($visitor_email)) { $errors .= "\n Bad email value!"; } if(empty($_SESSION['6_letters_code'] ) || strcasecmp($_SESSION['6_letters_code'], $_POST['6_letters_code']) != 0) { //Note: the captcha code is compared case insensitively. //if you want case sensitive match, update the check above to // strcmp() $errors .= "\n The captcha code does not match!"; } if(empty($errors)) { //send the email $to = $your_email; $subject="New form submission For Press Release"; $from = $your_email; $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; $body = "A user $name submitted the contact form:\n". "Name: $name\n". "Email: $visitor_email \n". "Message: \n ". "$user_message\n". "IP: $ip\n"; $headers = "From: $from \r\n"; $headers .= "Reply-To: $visitor_email \r\n"; mail($to, $subject, $body,$headers); header('Location: thank-you.php'); } } // Function to validate against any email injection attempts function IsInjected($str) { $injections = array('(\n+)', '(\r+)', '(\t+)', '(%0A+)', '(%0D+)', '(%08+)', '(%09+)' ); $inject = join('|', $injections); $inject = "/$inject/i"; if(preg_match($inject,$str)) { return true; } else { return false; } } ?>
The Gleaner Online
7 North Street,
Kingston, Jamaica
(876) 932-6262/6294
(876) 922-3196
firstlook@go-jamaica.com
Nordia Johns-Brown |
922-3400 ext 6073 |
Rainford Wint
|
922-3400 ext 6277 |
Samantha Crooks
|
922-3400 ext 6290 |
Ticoan Myrie
|
922-3400 ext 6296 |
Kimberly Hobson-Chung
|
922-3400 ext 6137 |
|