Jump to content

Retrive data from form and display from database..


joinx

Recommended Posts

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>

<?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;

?>

Archived

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

×
×
  • 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.