I want to display "Add to cart button" under the name and price cells. Is it possible to place it in a table or through some other wa to have the button under each item rather than having them all together on top. Here is the code
<html>
<head>
<title> product</title>
</head>
<body>
<?php
$hostname = "shopbyclickorg.ipagemysql.com";
$username = "shopbyclickorg";
$password = "******";
if(!($link = mysql_connect($hostname,$username,$password)))
die("Could not connect to database.");
$databasename = "e_commercedb";
if(!(mysql_select_db($databasename,$link)))
die("Could not open table.");
$result =mysql_query( 'SELECT * FROM product');
Print "<table border cellpadding=3>";
while ($row = mysql_fetch_array( $result )) {
Print "<tr>";
Print "<th>Name:</th> <td>".$row['PName'] . "</td> ";
Print "<th>price:</th> <td>".$row['Pprice'] . " </td></tr>";
?>
<form method="post" action="https://www.paypal.com/cgi-bin/webscr" target="_blank">
<input type="hidden" name="business" value="rubayya_abbasi@yahoo.com">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<input type="hidden" name="item_name" value="<?php echo $row['PName'] ?>" />
<input type="hidden" name="item_number" value="<?php echo $row['PID'] ?>" />
<input type="hidden" name="amount" value="<?php echo $row['Pprice'] ?>" />
<input type="hidden" name="quantity" value="1">
<input type="hidden" name="return" value="http://www.shopbyclick.org">
<input type="image" src="images/addcart.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
</form>
</br>
<?php
}
?>
</body>
</html>
The output that I m getting is in the attached file.

New Topic/Question
Reply




MultiQuote






|