Hello,

I noticed that when you click "customize this item", it takes you to define_page_2.php where the item's serial number is automatically posted in the "model number". What I want to do is add the item's photo as well.

How can I do that?

This is what the text field of "model number" is grabbing:
PHP Code:
<? 
if($_SESSION['customer_id']) {
    if($_POST["step"]) {
        $sql = "
            insert into " . TABLE_CUSTOMERS_CUSTOMIZATION . " (customers_id, products_id, page, description) 
                select '" . (int)$_SESSION['customer_id'] . "', products_id, 2, '{$_POST[description]}' 
                from " . TABLE_PRODUCTS . "
                where products_model = '{$_POST[model]}'
        ";
    
        $db->Execute($sql);
        
        function _mail($mailto, $from_mail, $from_name, $replyto, $subject, $message) {
            $header = "From: ".$from_name." <".$from_mail.">\r\n";
            $header .= "Bcc: ".$replyto."\r\n";
            $header .= "Reply-To: ".$replyto."\r\n";
            $header .= "MIME-Version: 1.0\r\n";
            $header .= "Content-type:text/html; charset=utf-8\r\n";
            //$header .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
            $header .= "<pre>".$message."</pre>\r\n\r\n";
            if (mail($mailto, $subject, "", $header)) {
                
            } else {
                
            }
        }
        
        $sql2 = "SELECT customers_email_address, customers_firstname, customers_lastname
                FROM " . TABLE_CUSTOMERS . " 
              WHERE customers_id = ".(int)$_SESSION['customer_id'];
    
        $check_customer = $db->Execute($sql2);
        $my_mail= $check_customer->fields['customers_email_address'];
        $my_name = $check_customer->fields['customers_firstname']. " ".$check_customer->fields['customers_lastname'];
        // how to use
        $my_replyto = $my_mail;
        $my_subject = "Customization";
        $my_message = "Hello,\r\nA new cutomization has been requested from $my_name on your model [{$_POST[model]}]:\r\n\r\n{$_POST[description]}\r\n\r\n".STORE_NAME;
        _mail(STORE_OWNER_EMAIL_ADDRESS, $my_mail, $my_name, $my_replyto, $my_subject, $my_message);
        echo '<div class="mainContent success"><img src="includes/templates/classic/images/icons/success.gif" alt="Success" title=" Success " height="20" width="20">  Your message has been successfully sent.</div>';
    }
    ?>
    
    <form id="form1" name="form1" method="post" action="">
    <fieldset id="contactUsForm">
        <legend>Customize a product</legend><br />
        <label class="inputLabel">Model Number:</label>
        <input name="model" size="40" id="model" type="text" value="<?=$_POST["step"]?"":$_GET["model"]?>"><br class="clearBoth">
        <br class="clearBoth">
        <label class="inputLabel">Description:</label><br class="clearBoth">
        <textarea name="description" cols="20" rows="7" id="description"></textarea>
        
        <input name="step" type="hidden" value="1" />
    </fieldset>
        <div class="buttonRow forward"><input src="includes/templates/classic/buttons/english/button_submit.gif" alt="Submit" title=" Submit " type="image"></div>
        
     </form>
<?
}
?>
I think it's something similar, maybe something like that but I'm not sure.

Here is the code of the page that grabs the product's image..
PHP Code:
<?php
?>
<?php 
require(DIR_WS_MODULES zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE)); ?> 
<div id="productMainImage" class="centeredContent">
<!-- bof Zen Lightbox v1.4 aclarke 2007-09-15 -->
<?php

if ($current_page_base == 'product_reviews') {

$zen_lightbox_products_name $products_name_reviews_page;

} else {

$zen_lightbox_products_name $products_name;

}

if (
ZEN_LIGHTBOX_STATUS == 'true') {

echo 
'<script language="javascript" type="text/javascript"><!--
document.write(\'<a href="' 
zen_lightbox($products_image_largeaddslashes($products_name), LARGE_IMAGE_WIDTHLARGE_IMAGE_HEIGHT) . '" rel="lightbox[gallery]" title="'addslashes($zen_lightbox_products_name) . '">' zen_image($products_image_mediumaddslashes($products_name), MEDIUM_IMAGE_WIDTHMEDIUM_IMAGE_HEIGHT) . '</a><br /><a href="' zen_lightbox($products_image_largeaddslashes($products_name), LARGE_IMAGE_WIDTHLARGE_IMAGE_HEIGHT) . '" rel="lightbox[gallery]" title="'addslashes($zen_lightbox_products_name) .'"><span class="imgLink">' TEXT_CLICK_TO_ENLARGE '</span></a>\')//--></script>';

} else {

echo 
'<script language="javascript" type="text/javascript"><!--
document.write(\'<a href="javascript:popupWindow(\\\'' 
zen_href_link(FILENAME_POPUP_IMAGE'pID=' $_GET['products_id']) . '\\\')">' zen_image($products_image_mediumaddslashes($products_name), MEDIUM_IMAGE_WIDTHMEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' TEXT_CLICK_TO_ENLARGE '</span></a>\')//--></script>';

}

?>
<!-- eof Zen Lightbox v1.4 aclarke 2007-09-15 -->
<noscript>
<?php
  
echo '<a href="' zen_href_link(FILENAME_POPUP_IMAGE'pID=' $_GET['products_id']) . '" target="_blank">' zen_image($products_image_medium$products_nameMEDIUM_IMAGE_WIDTHMEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' TEXT_CLICK_TO_ENLARGE '</span></a>';
?>
</noscript>
</div>
Help is appreciated