joinx Posted April 24, 2008 Share Posted April 24, 2008 i am working on an ecommerce project.. i have to retrive product dada from database n display on new page.. this i was able to do .. Its displaying with a button and more info(for details of product) when user click on either the button or the more info link...it should retrieve the product id thn display the details of the product or add it to the cart.. how should i do that.. rite now using these codes but not working.. <?php $imageurl = $row['product_image'] ?> <tr> <td width="307"> <p><img src="<?php echo $imageurl; ?>" /> <?php echo $row['product_name']."<br><font color=red>Price:</font>Rs".$row['product_price'];?></p> <form id="form1" method="details.php" action="POST"> <input name="product_id" type="hidden" value="%s"/> <a href="details.php">More Info</a> </form> <form name="form" action="showcart.php" method="POST"> <input name="product_id" type="hidden" value="%s"/> <input type="submit" value="Add To cart"> <input type="hidden" name="MM_insert" value="form" /> </form> </form></td> </tr> <?php } ?> </table> Link to comment https://forums.phpfreaks.com/topic/102797-retrive-data-from-form-and-display-from-database/ Share on other sites More sharing options...
jonsjava Posted April 24, 2008 Share Posted April 24, 2008 <?php $imageurl = $row['product_image']; $product_name = $row["product_name"]; $product_price = $row['product_price']; echo <<<END <tr> <td width="307"> <p><img src="$imageurl" /> $product_name <font color=red>Price:</font>Rs$product_price</p> <form id="form1" method="details.php" action="POST"> <input name="product_id" type="hidden" value="%s"/> <a href="details.php">More Info[/url] </form> <form name="form" action="showcart.php" method="POST"> <input name="product_id" type="hidden" value="%s"/> <input type="submit" value="Add To cart"> <input type="hidden" name="MM_insert" value="form" /> </form> </form></td> </tr> </table> END; ?> Link to comment https://forums.phpfreaks.com/topic/102797-retrive-data-from-form-and-display-from-database/#findComment-526553 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.