Change your last form like below so you will have unique entries for each product and build an array:
PHP Code:
<html> <head> <title>Create a Mixed Pallet Form: Step 2</title> </head> <body> <h1>Mixed Pallet Form For Sales Order#<?php echo $_POST['sales_order_number'] ; ?></h1> <form method="post" action="mixedpallet2.php"> <input type="hidden" name="sales_order_number" value="<?php echo $_POST['sales_order_number']; ?>" /> <input type="hidden" name="products" value="<?php echo $_POST['products']; ?>" /> <table cellspacing=5 cellpadding=5> <?php for ($i = 0 ; $i < (int)$_POST['products']; $i++) { echo " <tr> <td valign=top><strong>Item: $i:</strong> <td valign=top><input type='text' name='item[$i]' size=25 maxlength=30></td> <td valign=top><strong>Qty:</strong><input type='text' name='qty[$i]' size=3 maxlength=3> </tr>"; } ?> <tr> <td align=center colspan=3><input type="submit" value="Generate Mix Pallet Form"></td> </tr> </table> </form> </body> </html>
Then your next page will have matching content arrays:
PHP Code:
<?php $i = 0; while($i < count((int)$_POST['products'])) { echo $_POST['item'][$i]; // Contains item number echo $_POST['qty'][$i]; // Contains qty number for item above $i++; } ?>

__________________
<mgraphic /> - I don't have a solution but I admire the problem.
Last edited by mgraphic; 06-11-2006 at 10:48 PM..
|