Posted by Mike Biggi on 10/02/05 01:52
I have a form that is generated dynamically. The form has a bunch of
images in a table with a check box for each image. I want it so the
customer can check the box for each item he wants and then post the form
to a new page where the customers sees only his selections and a field
to choose quantities for each part he wants to order (I have already
done that part). The names of the fields are created dynamically, and I
have no way of knowing which ones to add in the for post
(.php?32435=3&8787=23&77687678=2) like I normally would do when I post a
form. If I try to step through the array I end up adding stuff twice, so
there has got to be a better way. How do I tell PHP to process the item
number and quantity as part of one record?
example:
customer chooses stock number 72132 and 37332, so I take him to a form
that has only the items he chose in the previous form. Now I need him to
give me the quantities of each item he wants, so I build a new form that
has $stocknumber . "quantity" as the form field name. Posting this new
form results in a foreach loop seems to post each form var as a new
record, instead of stock number and quantity as a single record.
Bottom Line? How can I add stuff in bulk (20 to 30 items at once) to a
shopping cart?
[Back to original message]
|