/*==================================================================*\ ###################################################################### # # # Copyright 2005 Arca Solutions, Inc. All Rights Reserved. # # # # This file may not be redistributed in whole or part. # # eDirectory is licensed on a per-domain basis. # # # # ---------------- eDirectory IS NOT FREE SOFTWARE ----------------- # # # # http://www.edirectory.com | http://www.edirectory.com/license.html # ###################################################################### \*==================================================================*/ # ---------------------------------------------------------------------------------------------------- # * FILE: /contactus.php # ---------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------- # LOAD CONFIG # ---------------------------------------------------------------------------------------------------- include("./conf/loadconfig.inc.php"); # ---------------------------------------------------------------------------------------------------- # SESSION # ---------------------------------------------------------------------------------------------------- session_start(); # ---------------------------------------------------------------------------------------------------- # VALIDATION # ---------------------------------------------------------------------------------------------------- include(EDIRECTORY_ROOT."/includes/code/validate_frontrequest.php"); # ---------------------------------------------------------------------------------------------------- # SITE CONTENT # ---------------------------------------------------------------------------------------------------- $contentObj = new Content("", EDIR_LANGUAGE); $sitecontentinfo = $contentObj->retrieveContentInfoByType("Contact Us"); if ($sitecontentinfo) { $headertagtitle = $sitecontentinfo["title"]; $headertagdescription = $sitecontentinfo["description"]; $headertagkeywords = $sitecontentinfo["keywords"]; $sitecontent = $sitecontentinfo["content"]; } else { $headertagtitle = ""; $headertagdescription = ""; $headertagkeywords = ""; $sitecontent = ""; } # ---------------------------------------------------------------------------------------------------- # SUBMIT # ---------------------------------------------------------------------------------------------------- if ($_SERVER["REQUEST_METHOD"] == "POST") { $_POST["email"] = system_denyInjections($_POST["email"]); $_POST["name"] = system_denyInjections($_POST["name"]); $_POST["title"] = system_denyInjections($_POST["title"]); $_POST["messageBody"] = system_denyInjections($_POST["messageBody"]); } # ---------------------------------------------------------------------------------------------------- # HEADER # ---------------------------------------------------------------------------------------------------- $headertag_title = $headertagtitle; $headertag_description = $headertagdescription; $headertag_keywords = $headertagkeywords; include(EDIRECTORY_ROOT."/layout/header.php"); ?>
// BASE JOIN include(INCLUDES_DIR."/views/view_join.php"); ?> //GOOGLE ADS include(INCLUDES_DIR."/code/google_ads.php"); ?>
if ($sitecontent) { echo "".$sitecontent.""; } ?> // Contact Us ///////////////////////////////////////////// if (($send) && ($_POST)) { if (md5($_POST["captchatext"]) != $_SESSION["captchakey"]) { $captchaerror = true; } $emailerror = false; if (!validate_email($_POST["email"])) { $emailerror = true; } $nameerror = false; if (!$_POST["name"]) { $nameerror = true; } $titleerror = false; if (!$_POST["title"]) { $titleerror = true; } $messageerror = false; if (!$_POST["messageBody"]) { $messageerror = true; } if (!$captchaerror && !$emailerror && !$nameerror && !$titleerror && !$messageerror) { $_POST["email"] = stripslashes($_POST["email"]); $_POST["name"] = stripslashes($_POST["name"]); $_POST["title"] = stripslashes($_POST["title"]); $_POST["messageBody"] = stripslashes($_POST["messageBody"]); $from_email = $_POST["email"]; $from_name = $_POST["name"]; $subject = $_POST["title"]; $messageBody = $_POST["messageBody"]; $messageBody = str_replace("\r\n", "\n", $messageBody); $messageBody = str_replace("\n", "\r\n", $messageBody); setting_get("sitemgr_email", $sitemgr_email); $sitemgr_emails = split(",", $sitemgr_email); setting_get("sitemgr_contactus_email", $sitemgr_contactus_email); $sitemgr_contactus_emails = split(",", $sitemgr_contactus_email); if ($sitemgr_contactus_emails[0]) { foreach ($sitemgr_contactus_emails as $sitemgr_contactus_email) { system_mail($sitemgr_contactus_email, "[Message sent through ".EDIRECTORY_TITLE." - Contact Us] ".stripslashes($subject), stripslashes($messageBody), "$from_name <$from_email>", "text/html"); } } elseif ($sitemgr_emails[0]) { foreach ($sitemgr_emails as $sitemgr_email) { system_mail($sitemgr_email, "[Message sent through ".EDIRECTORY_TITLE." - Contact Us] ".stripslashes($subject), stripslashes($messageBody), "$from_name <$from_email>", "text/html"); } } $message_style = "successMessage"; $contactus_message = system_showText(LANG_CONTACTMSGSUCCESS); unset($_POST["email"]); unset($_POST["name"]); unset($_POST["title"]); unset($_POST["messageBody"]); } else { if ($nameerror) { $contactus_message .= system_showText(LANG_MSG_CONTACT_TYPE_NAME)."
"; } if ($emailerror) { $contactus_message .= system_showText(LANG_MSG_CONTACT_ENTER_VALID_EMAIL)."
"; } if ($titleerror) { $contactus_message .= system_showText(LANG_MSG_CONTACT_TYPE_SUBJECT)."
"; } if ($messageerror) { $contactus_message .= system_showText(LANG_MSG_CONTACT_TYPE_MESSAGE)."
"; } if ($captchaerror) { $contactus_message .= system_showText(LANG_MSG_CONTACT_TYPE_CODE)."
"; } $message_style = "errorMessage"; $contactus_message .= system_showText(LANG_MSG_CONTACT_CORRECTIT_TRYAGAIN); } } /////////////////////////////////////////////////////////// ?> if ($contactus_message) { ?> } ?>