Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product ID in page


Guest

Recommended Posts

I am placing a link in the text of the page_info.php - below item description, and I want the link to be dl/[PRODUCT_ID]

 

where [PRODUCT_ID] is the ID of the product being viewed, as shown in URL!

 

I tried putting <a href=dl/p.products_id>, then tried putting dl/<?php p.products_id ?> hoping it would do it, with no luck.

e.g. if the product ID is 15 then link URL is dl/15!

 

Can anybody give me any guidance on this?

 

Thanks alot

Link to comment
Share on other sites

What is it that you are trying to download? You need a filetype for the file. Or are you trying to access the downloads directory?

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Try this

<tr>
<td align="center" class="main">
  <?php 
$file = sprintf("%s.zip", $product_info['products_id']);
echo '<a href="http://www.yoursite.com/downloads/' .$file . '">' . "Download" . '</a>'; 
  ?></td>
</tr>

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...