示例#1
0
  Released under the GNU General Public License
*/
require 'includes/application_top.php';
require DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTACT_US;
if (isset($HTTP_GET_VARS['action']) && $HTTP_GET_VARS['action'] == 'send' && isset($HTTP_POST_VARS['formid']) && $HTTP_POST_VARS['formid'] == $sessiontoken) {
    $error = false;
    $name = tep_db_prepare_input($HTTP_POST_VARS['name']);
    $email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);
    $enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
    if (!tep_validate_email($email_address)) {
        $error = true;
        $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
    }
    $actionRecorder = new actionRecorder('ar_contact_us');
    if (!$actionRecorder->check()) {
        $error = true;
        $messageStack->add('contact', sprintf(ERROR_ACTION_RECORDER, defined('MIN_CONTACT_US_EMAIL_MINUTES') ? (int) MIN_CONTACT_US_EMAIL_MINUTES : 15));
    }
    if ($error == false) {
        tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);
        $actionRecorder->record();
        tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
    }
}
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php 
echo HTML_PARAMS;
?>
示例#2
0
 } elseif (!xos_validate_email($to_email_address)) {
     $error = true;
     $messageStack->add('friend', ERROR_TO_ADDRESS);
     $smarty->assign('error_to_address', true);
 }
 if (!isset($_SESSION['customer_id'])) {
     if (!isset($_POST['process_id']) || $_POST['security_code'] != str_decrypt($_POST['process_id'])) {
         $error = true;
         $messageStack->add('friend', ERROR_SECURITY_CODE);
     }
 }
 if ($error == true) {
     $smarty->assign('error_security_code', true);
 }
 $actionRecorder = new actionRecorder('ar_tell_a_friend', isset($_SESSION['customer_id']) ? $_SESSION['customer_id'] : null, $from_name);
 if (!$actionRecorder->canPerform() && $actionRecorder->check()) {
     $error = true;
     $actionRecorder->record(false);
     $messageStack->add('friend', sprintf(ERROR_ACTION_RECORDER, defined('MODULE_ACTION_RECORDER_TELL_A_FRIEND_EMAIL_MINUTES') ? (int) MODULE_ACTION_RECORDER_TELL_A_FRIEND_EMAIL_MINUTES : 15));
 }
 if ($error == false) {
     //      $lng_code_query = xos_db_query("select code from " . TABLE_LANGUAGES . " where languages_id = '" . (int)$_SESSION['languages_id'] . "'");
     //      $customer_lng = xos_db_fetch_array($lng_code_query);
     $email_subject = sprintf(TEXT_EMAIL_SUBJECT, $from_name, STORE_NAME);
     $smarty->unregisterFilter('output', 'smarty_outputfilter_trimwhitespace');
     if (xos_not_null($message)) {
         $smarty->assign('message', $message);
     }
     $smarty->assign(array('html_params' => HTML_PARAMS, 'xhtml_lang' => XHTML_LANG, 'charset' => CHARSET, 'store_name_address' => STORE_NAME_ADDRESS, 'store_name' => STORE_NAME, 'src_embedded_shop_logo' => 'cid:shop_logo', 'src_shop_logo' => HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . (is_file(DIR_FS_CATALOG . 'images/email_shop_logo/' . EMAIL_SHOP_LOGO) ? 'email_shop_logo/' : 'catalog/templates/' . SELECTED_TPL . '/') . EMAIL_SHOP_LOGO, 'to_name' => $to_name, 'from_name' => $from_name, 'products_name' => $product_info['products_name'], 'link_filename_product_info' => xos_href_link(FILENAME_PRODUCT_INFO, 'p=' . (int) $_GET['p'], 'NONSSL', false, false)));
     //      $smarty->assign('link_filename_product_info', xos_href_link(FILENAME_PRODUCT_INFO, 'p=' . (int)$_GET['p'] . '&lnc=' . $customer_lng['code'], 'NONSSL', false, false));
     $smarty->configLoad('languages/' . $_SESSION['language'] . '_email.conf', 'tell_a_friend_email_html');