Page 1 of 6 123 ... LastLast
Results 1 to 10 of 57
  1. #1
    Join Date
    Nov 2010
    Posts
    101
    Plugin Contributions
    0

    Default Adding Multiple Images to Custom form To be sent to Admin Email

    I have most of my custom form created, now i'm running into some problems allowing multiple image uploads into form. Then have these images attached to the email. I have search for information, but not getting nowhere. This custom form is based off of DrByte's contribution band-signup (which didn't include any image support). The form is at http://qualityautowi.com/index.php?m...ehicle_tradein any help would be greatly appreciated.

  2. #2
    Join Date
    Nov 2010
    Posts
    101
    Plugin Contributions
    0

    Default Re: Adding Multiple Images to Custom form To be sent to Admin Email

    ok I have worked out how to get the multiple images button on my custom form. Now I have a piece of code that would take those images and attach them in a email. I'm just not sure how to implement this code to work in the header.php file. If you have any other ways to go about doing this would be greatly appreciated.

    PHP Code:
    <?php
        
    // did files get sent
        
    if(isset($_FILES) && (bool) $_FILES) {
        
            
    // define allowed extensions
            
    $allowedExtensions = array("pdf","doc","docx","gif","jpeg","jpg","png","rtf","txt");
            
    $files = array();
                
            
    // loop through all the files
            
    foreach($_FILES as $name=>$file) {
            
                
    // define some variables
                
    $file_name $file['name']; 
                
    $temp_name $file['tmp_name'];
                
                
    // check if this file type is allowed
                
    $path_parts pathinfo($file_name);
                
    $ext $path_parts['extension'];
                if(!
    in_array($ext,$allowedExtensions)) {
                    die(
    "extension not allowed");
                }
                
                
    // move this file to the server YOU HAVE TO DO THIS
                
    $server_file "/var/www/uploads/$path_parts[basename]";
                
    move_uploaded_file($temp_name,$server_file);
                
                
    // add this file to the array of files
                
    array_push($files,$server_file);
            }    
                
            
    // define some mail variables
            
    $to "seanclarkg######################";
            
    $from "[email protected]"
            
    $subject ="test attachment"
            
    $msg "here ya go";
            
    $headers "From: $from";
            
            
    // define our boundary
            
    $semi_rand md5(time()); 
            
    $mime_boundary "==Multipart_Boundary_x{$semi_rand}x";
            
            
    // tell the header about the boundary
            
    $headers .= "\nMIME-Version: 1.0\n";
            
    $headers .= "Content-Type: multipart/mixed;\n";
            
    $headers .= " boundary=\"{$mime_boundary}\""
            
            
    // part 1: define the plain text email
            
    $message ="\n\n--{$mime_boundary}\n";
            
    $message .="Content-Type: text/plain; charset=\"iso-8859-1\"\n";
            
    $message .="Content-Transfer-Encoding: 7bit\n\n" $msg "\n\n";
            
    $message .= "--{$mime_boundary}\n";
            
            
    // part 2: loop and define mail attachments
            
    foreach($files as $file) {
                
    $aFile fopen($file,"rb");
                
    $data fread($aFile,filesize($file));
                
    fclose($aFile);
                
    $data chunk_split(base64_encode($data));
                
    $message .= "Content-Type: {\"application/octet-stream\"};\n";
                
    $message .= " name=\"$file\"\n";
                
    $message .= "Content-Disposition: attachment;\n";
                
    $message .= " filename=\"$file\"\n";
                
    $message .= "Content-Transfer-Encoding: base64\n\n" $data "\n\n";
                
    $message .= "--{$mime_boundary}\n";
            }
        
            
    // send the email
            
    $ok mail($to$subject$message$headers); 
            if (
    $ok) { 
                echo 
    "<p>mail sent to $to!</p>"
            } else { 
                echo 
    "<p>mail could not be sent!</p>"
            }
            die();
        }
    ?>
    and this is the header.php file

    PHP 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');
      
    $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']));

        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_NAMESEND_TO_ADDRESSEMAIL_SUBJECT$email_text$first_name ' ' $last_name$email_address, array('EMAIL_MESSAGE_HTML' => $email_html), 'band_signup');

          
    zen_redirect(zen_href_link(FILENAME_BAND_SIGNUP'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'];
      }

    ?>
    Also I have found another solution that may work, but not sure how to go about doing this. The solution is at http://stackoverflow.com/questions/6...multiple-files This solution says to use phpmailer. Don't know if this would work.
    Last edited by GodfatherAntiques; 16 Jan 2013 at 12:59 AM. Reason: add more information

  3. #3
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    984
    Plugin Contributions
    6

    Default Re: Adding Multiple Images to Custom form To be sent to Admin Email

    See posts by ladybugmom in this thread

    http://www.zen-cart.com/showthread.p...905#post809905

  4. #4
    Join Date
    Nov 2010
    Posts
    101
    Plugin Contributions
    0

    Default Re: Adding Multiple Images to Custom form To be sent to Admin Email

    I really appreciate your help dw08gm. I have read through the entire forum and not really finding out the information that is needed to attach the uploaded files to the email. I know zen cart uses a function called phpmailer which will allow attaching the uploaded files to the email, but not really sure how to go about doing that.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Adding Multiple Images to Custom form To be sent to Admin Email

    The concept is:
    1. Create an array with your file attachment data:
    Code:
    $att_array = array('file' => $attachment_file, 'name' => basename($attachment_file), 'mime_type'=>$attachment_filetype);
    Of course, substituting the correct information for each of those $attachment_xxxxxx variables:
    $attachment_file is the actual complete physical path (on the server) to the file being attached -- that is, wherever you moved the files to during your upload
    $attachment_filetype is the MIME type for that file. If you skip the 'mime_type' part of this array, it will use application/octet-stream as a safe fallback.
    If you need to handle submitting multiple files, you can make it a nested array.

    2. Then include that array in your email data:
    Code:
          zen_mail(STORE_NAME, SEND_TO_ADDRESS, EMAIL_SUBJECT, $email_text, $first_name . ' ' . $last_name, $email_address, array('EMAIL_MESSAGE_HTML' => $email_html), 'band_signup', $att_array);
    3. MIME-HTML must be enabled in your Admin->Configuration->Email Options settings.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Nov 2010
    Posts
    101
    Plugin Contributions
    0

    Default Re: Adding Multiple Images to Custom form To be sent to Admin Email

    Thank you DrByte for responding i'm not an expert is php. I'm not quite sure where the files are being uploaded. I have a folder in my directory images/uploads/ and that is where I want these files to go. Here is the bit of jscript that makes the image upload work.

    PHP Code:

    function addElement()
            {
                var 
    ni document.getElementById('org_div1');
                var 
    numi document.getElementById('theValue');
                var 
    num = (document.getElementById('theValue').value -1)+ 2;
                
    numi.value num;
                var 
    newDiv document.createElement('div');
                var 
    divIdName num;  newDiv.setAttribute('id',divIdName);

                
    newDiv.innerHTML '<input type="file"  class="fileupload" size="80" name="file' + (num) + '" onchange="addElement()"/> <a class="removelink" onclick=\'removeElement(' divIdName ')\'>Remove This File</a>';

                
    // add the newly created element and it's content into the DOM
                
    ni.appendChild(newDiv);
            }

            function 
    removeElement(divNum)
            {
                var 
    document.getElementById('org_div1');
                var 
    olddiv document.getElementById(divNum);

                
    d.removeChild(olddiv);
            } 
    Also i'm not familiar with creating arrays, but i'm guessing that would go into the header.php file. If you could provide me with the code need to add that would be greatly appreciated.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Adding Multiple Images to Custom form To be sent to Admin Email

    Quote Originally Posted by GodfatherAntiques View Post
    I'm not quite sure where the files are being uploaded.
    Your previous post contained this:
    Code:
                // move this file to the server YOU HAVE TO DO THIS
                $server_file = "/var/www/uploads/$path_parts[basename]";
                move_uploaded_file($temp_name,$server_file);
    You would need to use the same path.

    It might possibly be a bit simpler if you used the built-in upload class. You'll find examples of its use in /includes/classes/shopping_cart.php and /admin/includes/modules/new_product_preview.php
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Nov 2010
    Posts
    101
    Plugin Contributions
    0

    Default Re: Adding Multiple Images to Custom form To be sent to Admin Email

    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 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');
      
    $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_NAMESEND_TO_ADDRESSEMAIL_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 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: 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_BACKBUTTON_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'304zen_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_SENDBUTTON_SEND_ALT); ?></div>



    <br class="clearBoth" />
    </div>
    </form>

    <?php
      
    }
    ?>
    </div>
    A little more imput would be greatly appreciate. Thank you Drbyte

  9. #9
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Adding Multiple Images to Custom form To be sent to Admin Email

    You need to do something in your code to set $path1, $path2, $attachment_filetype, etc, such as by processing the uploaded data in the $_FILES array
    General information about uploading files via PHP can be found on the PHP documentation site at http://php.net/manual/en/features.fi...ost-method.php
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Nov 2010
    Posts
    101
    Plugin Contributions
    0

    Default Re: Adding Multiple Images to Custom form To be sent to Admin Email

    I'm not quite sure what else to add...I do understand what you are saying. What other code would I need to add to make this work. I'm just learning how to use php. I know i'm almost there...thanks to your contribution.

 

 
Page 1 of 6 123 ... LastLast

Similar Threads

  1. v139h New Contact Form Email - Messages not being sent?
    By jazzyman in forum General Questions
    Replies: 9
    Last Post: 6 Feb 2013, 05:28 PM
  2. email address - sent from, multiple emails
    By illusionest in forum Basic Configuration
    Replies: 2
    Last Post: 10 Nov 2010, 02:18 AM
  3. Adding Multiple Images though Admin that also works with zen lightbox 1.4
    By headyntl in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 3 Jul 2008, 07:58 AM
  4. EMail Admin the same Email message that is sent to customer
    By dubya01 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 21 Aug 2007, 03:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg