Jump to content


Photo

Dynamic Link


  • Please log in to reply
No replies to this topic

#1 crazylegseddie

crazylegseddie
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts

Posted 08 April 2006 - 11:47 AM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users