exists("page") and !strpos($_SERVER["HTTP_REFERER"], "logout.html")){ $sess->save("page", $_SERVER["HTTP_REFERER"]); } $page_code = 'contact'; $sql = "SELECT title, left_content, center_content FROM app_site_pages WHERE page_code = '$page_code' AND site_code = '".SITE_CODE."'"; $rs = $db->createRecordSet($sql); $page = $db->fetchArray($rs); # Perform LogIn if (form_isset("submitted")){ $message = form_text("message"); $message = stripslashes($message); $email = form_email("email"); $txtCapcha = form_text("txtCapcha"); # Spam Check if (preg_match(' /[\r\n,;\'"]/ ', $email)){ $email = FALSE; } # New Addition : Machine Auto entry check if($_SESSION['capchaSubmate'] != $txtCapcha){ $captcha_test = FALSE; } else{ $captcha_test = TRUE; } if($email && $captcha_test){ //$success = email_send($email, WEBMASTER_EMAIL, "New Message from Contact Us Form", $message); $success = email_send($email, $name, "New Message from Contact Us Form", $message); if ($success){ html_redirect("contact_thankyou.html"); } } else if(!$email && !$captcha_test){ $errors[] = "Enter valid e-mail address and Enter the code shown bellow!"; } else if(!$email && $captcha_test){ $errors[] = "Invalid e-mail address!"; } else if($email && !$captcha_test){ $errors[] = "The code you entered and code shown on the image doesn't match. Please try again!"; } } $user = user_GetCurrent(); $email = $user["email"]; #title $smarty->assign("nav", "contact"); $smarty->assign("title", $page["title"]); # Meta $header = seo_GetPageHeader($page_code); $smarty->assign("page_header", $header); #main content $smarty->assign("errors", $errors); $smarty->assign("email", $email); $smarty->assign("message", $message); $content = listing_ReplaceFeaturedListings($page["left_content"]); $content = preg_replace('/#contact_us_form#/', $smarty->fetch("contact_form.tpl"), $content); $content = preg_replace('/#livehelp_icon#/', $smarty->fetch("livehelp.tpl"), $content); $smarty->assign("content", $content); $smarty->assign("search", array("search2.tpl")); $smarty->assign("contents", array("page_content1.tpl")); $smarty->assign("callouts", array("featured_vertical_new.tpl")); $smarty->display("main.tpl"); ?>