ok i'm having some success, but the images are not showing in the attachment in email. Not sure what I'm doing wrong. here is the new code for my header.php file
<?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');
$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('file' => $path1, 'name' => basename($path1), 'mime_type'=>$attachment_filetype);
$att_array = array('file' => $path2, 'name' => basename($path2), 'mime_type'=>$attachment_filetype);
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) {
// grab some customer info if logged in
if(isset($_SESSION['customer_id'])) {
$check_customer = $db->Execute("select first_name, last_name, email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
$email_address = $check_customer->fields['email_address'];
$customer_name = $check_customer->fields['first_name'] . ' ' . $check_customer->fields['last_name'];
} else {
$email_address = 'Not logged in';
$customer_name = 'Not logged in';
}
//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
// default email and name if customer is logged in
if(isset($_SESSION['customer_id'])) {
$check_customer = $db->Execute("select first_name, last_name, email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . $_SESSION['customer_id'] . "'");
if ($email_address == '') $email_address = $check_customer->fields['email_address'];
if ($first_name == '') $first_name = $check_customer->fields['first_name'];
if ($last_name == '') $last_name = $check_customer->fields['last_name'];
}
?>
and this is the code to my tpl.vehicle.tradein.default.php file
<?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: tpl_band_signup_default.php,v 1.3 2007/06/07 00:00:00 DrByteZen Exp $
//
?>
<div class="centerColumn" id="bandSignupDefault">
<h1 id="bandSignupDefaultHeading"><?php echo HEADING_TITLE; ?></h1>
<?php if ($messageStack->size('vehicle_tradein') > 0) echo $messageStack->output('vehicle_tradein'); ?>
<?php
if (isset($_GET['action']) && ($_GET['action'] == 'success')) {
?>
<div class="mainContent success"><?php echo TEXT_SUCCESS; ?></div>
<div class="buttonRow"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
<?php
} else {
?>
<?php echo zen_draw_form('vehicle_tradein', zen_href_link(FILENAME_VEHICLE_TRADEIN, 'action=send')); ?>
<div id="bandSignupContent" class="content">
<fieldset id="bandSignup-Info">
<legend>Contact Information</legend>
<div class="alert forward"><?php echo FORM_REQUIRED_INFORMATION; ?></div>
<br class="clearBoth" />
<label class="inputLabel" for="first_name">First Name:</label>
<?php echo zen_draw_input_field('first_name', zen_output_string_protected($first_name), ' size="70" id="first_name"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<label class="inputLabel" for="last_name">Last Name:</label>
<?php echo zen_draw_input_field('last_name', zen_output_string_protected($last_name), ' size="70" id="last_name"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<label class="inputLabel" for="phone_number">Phone Number:</label>
<?php echo zen_draw_input_field('phone_number', zen_output_string_protected($phone_number), ' size="70" id="phone_number"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<label class="inputLabel" for="email_address">Email Address:</label>
<?php echo zen_draw_input_field('email_address', zen_output_string_protected($email_address), ' size="70" id="email_address"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<label class="inputLabel" for="mailing_city">City:</label>
<?php echo zen_draw_input_field('mailing_city', zen_output_string_protected($mailing_city), ' size="70" id="mailing_city"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
</fieldset>
<fieldset id="bandSignup-Payment">
<legend>Vehicle Information</legend>
<label class="inputLabel" for="vehicle_year">Vehicle Year:</label>
<?php echo zen_draw_input_field('vehicle_year', zen_output_string_protected($vehcile_year), ' size="70" id="vehicle_year"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<label class="inputLabel" for="vehicle_make">Vehicle Make:</label>
<?php echo zen_draw_input_field('vehicle_make', zen_output_string_protected($vehicle_make), ' size="70" id="vehicle_make"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<label class="inputLabel" for="vehicle_model">Vehicle Model:</label>
<?php echo zen_draw_input_field('vehicle_model', zen_output_string_protected($vehicle_model), ' size="70" id="vehicle_model"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<label class="inputLabel" for="vehicle_mileage">Vehicle Mileage:</label>
<?php echo zen_draw_input_field('vehicle_mileage', zen_output_string_protected($vehicle_mileage), ' size="70" id="vehicle_mileage"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />
</fieldset>
<fieldset id="bandSignup-Payment">
<legend>Additional Comments</legend>
<?php echo zen_draw_textarea_field('comments', 30, 4, zen_output_string_protected($comments), 'id="comments"'); ?>
</fieldset>
<fieldset id="bandSignup-Payment">
<legend>Vehicle Images</legend>
<label class="inputLabel" for="image1"><?php echo 'Image 1' ?></label>
<?php echo zen_draw_file_field('ufile[]'); ?>
<br class="clearBoth" />
<label class="inputLabel" for="image2"><?php echo 'Image 2' ?></label>
<?php echo zen_draw_file_field('ufile[]'); ?>
<br class="clearBoth" />
</fieldset>
<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_SEND, BUTTON_SEND_ALT); ?></div>
<br class="clearBoth" />
</div>
</form>
<?php
}
?>
</div>
A little more imput would be greatly appreciate. Thank you Drbyte