Well – I guess that’s one reason why it’s better to pass an id with your key rather than a text description.
Do you have a numeric product id you could pass and then tie it back to the description on the other side of the posting?
If not you could do something like this:
<?
//SET YOUR ID TO ZERO BEFORE THE LOOP
//USE THE ID TO MATCH PRODUCT INFORMATION AFTER POSTING
$id++;
?>
<?=$row_Recordset1['description']?>: <input type='text' size=2 value='' name="product_qnty_<?=$id?>" />
<input type='hidden' name='product_desc_<?=$id?>' value="<?=$row_Recordset1['description']?>" />
This isn’t really the best way at going at this but since I don’t know your entire setup it helps fix what you’re trying to do.
Altered processing:
<?
//KEY FOR QUANTITY FIELDS
$qnty_key=”product_qnty_”;
//LOOP THROUGH THE POST FIELD
foreach($_POST as $key => $val)
{
//IF THE BEGINNING OF THE POST FIELD IS THE QUANTITY KEY AND THE VALUE IS A NUMBER AND THE NUMBER IS OVER ZERO
if(substr($key,0,strlen($qnty_key))==$qnty_key && is_numeric($val) && $val > 0)
{
$id=substr($key,strlen($qnty_key));
$prod_description=$_POST[‘product_desc_’.$id];
echo $prod_description.”: “.$val.””;
}
}
?>
Abraham