vikal Posted August 28, 2008 Posted August 28, 2008 hi good morning i have a small problem can any one help me...or suggest me the better way to solve the problem that i have well in product_info.php somewhere i have written like this echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_fileupload']) ."&download".'"target="_blank">' . tep_image_button('button_download.gif', 'IMAGE_BUTTON_DOWNLOAD') . '</a>'; <td class="main" align="right"> <?php //echo '<a href="' . tep_href_link(DIR_WS_IMAGES. $product_info['products_image']) . '"target="_blank">' .'</a>' ?> this is for the download the file $product_info['products_fileupload']) and $product_info['products_image']) is the image of $product_info['products_fileupload'])... yeah this works... in the above file you will find....&download... and to catch this requested download i have wrote like this on the same page <?php if(isset($_REQUEST['download'])){ tep_db_query("update" . TABLE_PRODUCTS. " set products_download = products_download+1 where products_id = '" . $_REQUEST['products_id'] . "'"); } ?> to increase the field created in the table ie products_download...and after download each file it will increase by 1.... but it did not work now tell the way how to increase products_download by 1 after immediately clicking the download button please help me or suggest me..and give me the way you are most apreciated for it best regards vikaL
shooter-boy Posted August 28, 2008 Posted August 28, 2008 Have you tried using $_GET['download'] rather than $_REQUEST['download'] ? But also, where is "$_REQUEST['products_id']" coming from? Shouldn't that be $_GET too? I think your link needs to be rewritten... <a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_fileupload'], '&download=true') . " target="_blank">' . tep_image_button('button_download.gif', 'IMAGE_BUTTON_DOWNLOAD') . '</a> That alone might fix it... Not sure, if you can link to your store it might be easier to work out. Rob Rob Bell - Inspired Graphix Customising osCommerce in Australia, and the world! View my profile for web and email links. I'm sorry, but i cannot offer Free support via PM etc, and osCommerce forums prohibit me from putting any reference to paid support in my signauture. However viewing my profile may provide links to my website or something like that which you may find useful.
vikal Posted August 28, 2008 Author Posted August 28, 2008 Have you tried using $_GET['download'] rather than $_REQUEST['download'] ? But also, where is "$_REQUEST['products_id']" coming from? Shouldn't that be $_GET too? I think your link needs to be rewritten... <a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_fileupload'], '&download=true') . " target="_blank">' . tep_image_button('button_download.gif', 'IMAGE_BUTTON_DOWNLOAD') . '</a> That alone might fix it... Not sure, if you can link to your store it might be easier to work out. Rob really so thanks for your guidance as you told me now i have done like this echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_fileupload'], '&download=true') .'"target="_blank">' . tep_image_button('button_download.gif', 'IMAGE_BUTTON_DOWNLOAD') . '</a>'; and in the same page there is code like this as you suggest me to do <?php if(isset($_GET['download'])){ tep_db_query("update" . TABLE_PRODUCTS. " set products_download = products_download+1 where products_id = '" .$_GET['products_id'] . "'"); } ?> but really...'&download=true' which we have provide in the link... could not reach upto... <?php if(isset($_GET['download'])){ tep_db_query("update" . TABLE_PRODUCTS. " set products_download = products_download+1 where products_id = '" .$_GET['products_id'] . "'"); } ?> or this does not catch does not catch the download=true really what next to do....
vikal Posted August 28, 2008 Author Posted August 28, 2008 hi robert bell let me tell another thing.... the link <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_fileupload'], 'download=true') .'"target="_blank">' . tep_image_button('button_download.gif', 'IMAGE_BUTTON_DOWNLOAD') . '</a>'; ?> <td class="main" align="right"> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES. $product_info['products_image']) . '"target="_blank">' .'</a>' ?> </td> is located in between the form(productinfo.php) td width="100%" valign="top" style="padding: 21px;"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> ''''' ' ' ' ' ' ' ' ' </form> may be due to this .....the above link could not pass download and the code <?php if(isset($_GET['download'])=="true"){ echo "test"; tep_db_query("update" . TABLE_PRODUCTS. " set products_download = products_download+1 where products_id='".$_GET['products_id']."'"); } ?> could not work tell me what to do waiting for you suggesstion
Recommended Posts
Archived
This topic is now archived and is closed to further replies.