riddhi Posted April 21, 2007 Share Posted April 21, 2007 I am developing a range.php where the customer may shop within the specified price range. Some relavant part of the code is as follows:- while ($record=mysql_fetch_array($res)){ if($record['PD_PRICE'] >= $start && $record['PD_PRICE'] <= $end) {// Display the Product if within the Price Range if($record['PD_THUMBNAIL']){ $cat_image=$record['PD_THUMBNAIL']; if($cat_image){ $cat_image = WEB_ROOT.'images/product/' . $cat_image; }// End If else $cat_image = WEB_ROOT.'images/no-image-small.png'; echo " <td width='75' align='left'><img src='$cat_image'>"; echo "<td>$record[PD_NAME]</td>"; echo "<td>$record[PD_PRICE]</td>"; }// End of Thumbnail IF echo "<b>"; echo "<td>$record[PD_DESCRIPTION]</td>"; echo "</b>"; echo "<img src= WEB_ROOT.'images/addToCart.gif'>"; }// ENDIF }// End While After every product is shown having matchin result, I want to add the following code after the addToCart.gif image has been pressed $_GET['p']=$record['PD_ID']; //set the product id addToCart(); but how will I get the product Id of the pressed button? please write a small to make it a bit more clear. Link to comment https://forums.phpfreaks.com/topic/48047-not-a-complex-problem/ Share on other sites More sharing options...
riddhi Posted April 22, 2007 Author Share Posted April 22, 2007 some one please help Link to comment https://forums.phpfreaks.com/topic/48047-not-a-complex-problem/#findComment-235062 Share on other sites More sharing options...
riddhi Posted April 22, 2007 Author Share Posted April 22, 2007 Someone please reply. Link to comment https://forums.phpfreaks.com/topic/48047-not-a-complex-problem/#findComment-235420 Share on other sites More sharing options...
Navarr Posted April 22, 2007 Share Posted April 22, 2007 You mean you want to know what the product id is when someone selects to buy that product using a "Buy" button? If so, then using individual forms for each product, you can create a hidden input <input type="hidden" name="productid" value="<?php echo $record['PD_ID']; ?>" /> If not, then please explain further. Link to comment https://forums.phpfreaks.com/topic/48047-not-a-complex-problem/#findComment-235431 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.