Forum Moderators: coopster
Thanks in advance.
I imagine there is no “easy” answer
Actually, there is! Two even.
1: Use separate forms for each item and have a hidden field for the item id.
2: Use one form for all items and name your submit buttons accordingly.
<input type="submit" name="item-number_abc123" value="Buy Now!" />
In the form processing script, loop the POST until you get the item key and then grab the actual item id off of it.
<?
foreach ($_POST as $key => $val){
if (strpos("item-number", $key)){
$i = explode ("_", $key);
$item_number = $i[1];
}
}
?>
$item_number now contains the id of the item.