so I have a variable that I would like to set based on some submitted form data. On the form I have a set of fields that the user can increase the number of (that is, they can add more of the same type of field), and so I need to set the script that handles the submitted data to accomodate this.
So far this is what I have:
while ($i <= $totalproducts) {
$product.$i = $_POST['product'.$i];
$i++;
}
$totalproducts holds the total number of fields. As an example, let's say I had 3 items, here's what I would like to get from the code:
$product1 = $_POST['product1'];
$product2 = $_POST['product2'];
$product3 = $_POST['product3'];
I'm sure I'm close, just can't quite slot it together...