Copyright (c) 2010 osCommerce

  Released under the GNU General Public License
*/
require 'includes/application_top.php';
require 'includes/languages/' . $language . '/contact_us.php';
if (isset($_GET['action']) && $_GET['action'] == 'send' && isset($_POST['formid']) && $_POST['formid'] == $sessiontoken) {
    $error = false;
    $name = tep_db_prepare_input($_POST['name']);
    $email_address = tep_db_prepare_input($_POST['email']);
    $enquiry = tep_db_prepare_input($_POST['enquiry']);
    if (!tep_validate_email($email_address)) {
        $error = true;
        $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
    }
    $actionRecorder = new actionRecorder('ar_contact_us', tep_session_is_registered('customer_id') ? $customer_id : null, $name);
    if (!$actionRecorder->canPerform()) {
        $error = true;
        $actionRecorder->record(false);
        $messageStack->add('contact', sprintf(ERROR_ACTION_RECORDER, defined('MODULE_ACTION_RECORDER_CONTACT_US_EMAIL_MINUTES') ? (int) MODULE_ACTION_RECORDER_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('contact_us.php', 'action=success'));
    }
}
$breadcrumb->add(NAVBAR_TITLE, tep_href_link('contact_us.php'));
require 'includes/template_top.php';
?>
Example #2
0
  Copyright (c) 2003 osCommerce

  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;