OK, you're entering into the biggest part of programming -- translation between PHP, HTML, and mySQL.
If you HARD-CODE it:
Add to Cart<BR>
<form ....>
Item 193: Widget
Enter Quantity:
<input type = text name="qty[193]">
<input type = hidden name="desc[193]" value="widget">
<input type = hidden name="price[193]" value="34.95">
<input type=submit name=n value="Add to Cart">
</form>
a better way in my estimation:
Add to Cart<BR>
<form ....>
Item 193: Widget
Enter Quantity:
<input type = text name="item[193][qty]">
<input type = hidden name="item[193][desc]" value="widget">
<input type = hidden name="item[193][price]" value="34.95">
<input type=submit name=n value="Add to Cart">
</form>
When your receive the post of the latter you can go:
<?php
foreach($item as $n=>$v){
echo "You chose " . $v['qty'] . " of item #" . $n . " for $v['price'] . "<BR>";
echo "(" . $v['desc'] . ")<BR>";
}
?>
You might as well get used to using arrays.
Also, if you're passing #193 as a unique identifier, and #193 is in a database, you really don't need the description and name and the like, since you can get this from the database.
Trust me, designing a good shopping cart is not easy, I did one for www.tanshop.com, you might try that out.
Sam Fullman,
Compasspoint Media