3rd you have to create /includes/modules/pages/your_custom_folder_name/header_php.php
HTML Code:
<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers |
// | |
// | http://www.zen-cart.com/index.php |
// | |
// | Portions Copyright (c) 2003 osCommerce |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available through the world-wide-web at the following url: |
// | http://www.zen-cart.com/license/2_0.txt. |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to |
// | [email protected] so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// $Id: header_php.php,v 1.3 2007/06/07 00:00:00 DrByteZen Exp $
//
require(DIR_WS_MODULES . 'require_languages.php');
include(DIR_WS_CLASSES . 'upload.php');
$breadcrumb->add(NAVBAR_TITLE);
$error = false;
$first_name = '';
$last_name = '';
$phone_number = '';
$email_address = '';
$mailing_city = '';
$vehicle_year = '';
$vehicle_make = '';
$vehicle_model = '';
$vehicle_mileage = '';
$comments = '';
if (isset($_GET['action']) && ($_GET['action'] == 'send')) {
$first_name = zen_db_prepare_input($_POST['first_name']);
$last_name = zen_db_prepare_input($_POST['last_name']);
$phone_number = zen_db_prepare_input($_POST['phone_number']);
$email_address = zen_db_prepare_input($_POST['email_address']);
$mailing_city = zen_db_prepare_input($_POST['mailing_city']);
$vehicle_year = zen_db_prepare_input($_POST['vehicle_year']);
$vehicle_make = zen_db_prepare_input($_POST['vehicle_make']);
$vehicle_model = zen_db_prepare_input($_POST['vehicle_model']);
$vehicle_mileage = zen_db_prepare_input($_POST['vehicle_mileage']);
$comments = zen_db_prepare_input(strip_tags($_POST['comments']));
$att_array = array();
foreach($_FILES as $key => $file) {
if (zen_not_null($_FILES[$key]['tmp_name'])) {
if ($upload = new upload($key, DIR_FS_UPLOADS)) {
$att_array[] = array('file' => $upload->destination . $upload->filename, 'name' => $upload->filename);
}
}
}
//Get the uploaded file information
$name_of_uploaded_file = basename($_FILES['uploaded_file']['name']);
//get the file extension of the file
$type_of_uploaded_file = substr($name_of_uploaded_file,
strrpos($name_of_uploaded_file, '.') + 1); $size_of_uploaded_file = $_FILES["uploaded_file"]["size"]/1024;//size in KBs
$path_of_uploaded_file = $upload_folder . $name_of_uploaded_file;
$tmp_path = $_FILES["uploaded_file"]["tmp_name"];
if(is_uploaded_file($tmp_path))
{
if(!copy($tmp_path,$path_of_uploaded_file)) { $errors .= '\n error while copying the uploaded file'; }}
if (!zen_validate_email($email_address)) {
$error = true;
$messageStack->add('email address', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
}
if (!zen_not_null($first_name)) {
$error = true;
$messageStack->add('first name', 'Please fill in the first_name');
}
if (!zen_not_null($last_name)) {
$error = true;
$messageStack->add('last name', 'Please fill in the last_name');
}
if (!zen_not_null($phone_number)) {
$error = true;
$messageStack->add('phone number', 'Please fill in the phone_number');
}
if (!zen_not_null($email_address)) {
$error = true;
$messageStack->add('email address', 'Please fill in the email_address');
}
if (!zen_not_null($mailing_city)) {
$error = true;
$messageStack->add('mailing city', 'Please fill in the mailing_city');
}
/*
if (!zen_not_null($contact2_firstname)) {
$error = true;
$messageStack->add('band_signup', 'Please fill in the contact2_firstname');
}
if (!zen_not_null($contact2_lastname)) {
$error = true;
$messageStack->add('band_signup', 'Please fill in the contact2_lastname');
}
if (!zen_not_null($contact2_phone)) {
$error = true;
$messageStack->add('band_signup', 'Please fill in the contact2_phone');
}
if (!zen_not_null($contact2_email)) {
$error = true;
$messageStack->add('band_signup', 'Please fill in the contact2_email');
}
*/
if (!zen_not_null($vehicle_year)) {
$error = true;
$messageStack->add('vehicle year', 'Please fill in the vehicle_year');
}
if (!zen_not_null($vehicle_make)) {
$error = true;
$messageStack->add('vehicle make', 'Please fill in the vehicle_make');
}
if (!zen_not_null($vehicle_model)) {
$error = true;
$messageStack->add('vehicle model', 'Please fill in the vehicle_model');
}
if (!zen_not_null($vehicle_mileage)) {
$error = true;
$messageStack->add('vehicle mileage', 'Please fill in the vehicle_mileage');
}
if ($error == false) {
//assemble the email contents:
$email_text = 'Vehicle Data Submission: ' . "\n" .
'------------------------------------------------------' . "\n" .
'First Name:' . "\t" . $first_name . "\n" .
'Last Name:' . "\t" . $last_name . "\n" .
'Phone Number:' . "\t" . $phone_number . "\n" .
'Email Address:' . "\t" . $email_address . "\n" .
'Mailing City:' . "\t" . $mailing_city. "\n" .
'Vehicle Year:' . "\t" . $vehicle_year . "\n" .
'Vehicle Make:' . "\t" . $vehicle_make . "\n" .
'Vehicle Model:' . "\t" . $vehicle_model . "\n" .
'Vehicle Mileage:' . "\t" . $vehicle_mileage . "\n" .
'Comments:' . "\t" . $comments . "\n\n" .
'------------------------------------------------------' . "\n" .
OFFICE_USE . "\t" . "\n" .
OFFICE_LOGIN_NAME . "\t" . $customer_name . "\n" .
OFFICE_LOGIN_EMAIL . "\t" . $customer_email . "\n" .
OFFICE_IP_ADDRESS . "\t" . $_SERVER['REMOTE_ADDR'] . "\n" .
OFFICE_HOST_ADDRESS . "\t" . gethostbyaddr($_SERVER['REMOTE_ADDR']) . "\n" .
OFFICE_DATE_TIME . "\t" . date("D M j Y G:i:s T") . "\n" .
'------------------------------------------------------' . "\n\n" .
$email_text = zen_output_string_protected($email_text);
$email_html = nl2br("\n" . $email_text);
//send the email
zen_mail(STORE_NAME, SEND_TO_ADDRESS, EMAIL_SUBJECT, $email_text, $first_name . ' ' . $last_name, $email_address, array('EMAIL_MESSAGE_HTML' => $email_html), 'vehicle_tradein', $att_array);
zen_redirect(zen_href_link(FILENAME_VEHICLE_TRADEIN, 'action=success'));
} //endif $error=false
} // endif action
?>