I\'m attempting to create a sort of marketplace. Each item on the market has a type (i.e. the item being sold), a value, a quantity, a seller name, and an id, and all of thi
My problem is that since each input field is the result of a while loop of unknown iterations, I can't simply hard code a name into each field. I've tried using a counter variable to keep track and make names, but it doesn't seem to be working.
Name your inputs like this:
Then, in your PHP, $_POST['myName'] or $_GET['myName'] is an array.
This is documented here.
On a related note, in order for the program to work, each field needs to send two values - the id (which I can use to look up the rest of the entry's values) and the quantity that the user wishes to purchase. I've been doing this with a hidden field before the input quantity field.
Sounds fine to me.