Hi all, I need to pass the data that has been selected in my cart to paypal through hidden form fields. The requirement from paypal are that each item must increment like input type="hidden" name="item_name1" value="item1"
I have my cart
and my paypal form code
I have my cart
Code:
<form name="frmCart" method="get">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr class="green">
<td width="15%" height="25">
Qty
</td>
<td width="55%" height="25">
Product
</td>
<td width="15%" height="25" >
Price Each
</td>
<td width="15%" height="25" >
Remove Item </td>
</tr>
<?php
while($row = mysql_fetch_array($result))
{
// Increment the total cost of all items
$totalCost += ($row["qty"] * $row["itemPrice"]);
?>
<tr>
<td width="15%" height="25">
<select name="<?php echo $row["itemId"]; ?>" onChange="UpdateQty(this)">
<?php
for($i = 1; $i <= 20; $i++)
{
echo "<option ";
if($row["qty"] == $i)
{
echo " SELECTED ";
}
echo ">" . $i . "</option>";
}
?>
</select>
</td>
<td width="55%" height="25">
<?php echo $row["item_name"]; ?>
</td>
<td width="20%" height="25">
$<?php echo number_format($row["itemPrice"], 2, ".", ","); ?>
</td>
<td width="10%" height="25">
<a href="cart.php?action=remove_item&id=<?php echo $row["itemId"]; ?>">Remove</a>
</td>
</tr>
<?php
}
// Display the total
?>
<tr>
<td width="100%" colspan="4">
<hr />
</td>
</tr>
<tr>
<td width="70%" colspan="2">
</td>
<td width="30%" colspan="2">
<b>Total: $<?php echo number_format($totalCost, 2, ".", ","); ?></b>
</td>
</tr>
</table>
</form>
Code:
<form action="[URL unfurl="true"]https://www.paypal.com/cgi-bin/webscr"[/URL] method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="info@test.com.au">
<input type="hidden" variable name="item_name_1" value="<?php echo $row["item_name"]; ?>1">
<input type="hidden" name="amount_1" value="<?php echo number_format($row["itemPrice"], 2, ".", ","); ?>">
<input type="hidden" name="currency_code" value="AUD">
<input type="image" src="[URL unfurl="true"]https://www.paypal.com/en_US/i/btn/x-click-but23.gif"[/URL] border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="[URL unfurl="true"]https://www.paypal.com/en_AU/i/scr/pixel.gif"[/URL] width="1" height="1">
</form>
How do I set this up so it is holding my first form values and increment to paypal specifications?