Jump to content

Dynamic Link


crazylegseddie

Recommended Posts

Hi I hope someone can help me with this problem Ive been trying to solve for ages now. Im using a shopping basket system and where it lists the product I have created a 'pd_more' section in the admin interface and added this to the database and what i need is it to link from the following page and display the information:

link for teh page ive created: [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]http://benswhitedisc.no-ip.info/TEST/whitedisc/categories.php?c=12&p=1[!--colorc--][/span][!--/colorc--]

[!--coloro:#3366FF--][span style=\"color:#3366FF\"][!--/coloro--]code block:[!--colorc--][/span][!--/colorc--]

<?php
if (!defined('WEB_ROOT')) {
exit;
}
$product = getProductDetail($pdId, $catId);
extract($product);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="10">
<tr>
<td align="center"><img src="<?php echo $pd_image; ?>" border="0" alt="<?php echo $pd_name; ?>"></td>
<td valign="middle">
<strong><?php echo $pd_name; ?></strong><br>
Price : </span><?php echo displayAmount($pd_price); ?><br>
<?php
// if we still have this product in stock
// show the 'Add to cart' button
if ($pd_qty > 0) {
?>
<input type="button" name="btnAddToCart" value="Add To Cart &gt;" onClick="window.location.href='<?php echo $cart_url; ?>';" class="addToCartButton">
<?php
} else {
echo 'Out Of Stock';
}
?>
</td>
</tr>
<tr align="left">
<td colspan="2"><?php echo $pd_description; ?><br><br>
[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]<?php echo '<a href="include/pd_more.php?">More...</a>';?>[!--colorc--][/span][!--/colorc--]

ive highlighted the part of the code that should link and retrieve this information from the database on a different page.

On the seperate page I have worked out the relevent query to perform:

$query = "select pd_more from tbl_product where pd_id=".$_GET['pd_id'];

I know i need something like this on the page e.g.

FETCH SINGLE ROW FOR PRODUCT WHOSE ID IS $_GET['id'];
ECHO INTO PAGE HEADING FOR PRODUCT NAME;
ECHO INTO PAGE TEXT FROM PRODUCT DETAIL;

but im not sure how I implement this.

thanks for your time and help.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.