I´m still new in php and I´m having trouble in sending a form vars through POST. I use a jquery to dynamically add new fields with the same name plus a auto increment ID in a form.
In the _POST I need to have a loop to get those vars, but how am I going to get the vars count for the loop?
I have something like this:
$ID1_name = $_POST["ID1_name"];
$ID2_name = $_POST["ID2_name"];
$ID3_name = $_POST["ID3_name"];
$IDX_name = $_POST["IDX_name"];
$ID1_place = $_POST["ID1_place"];
$ID2_place = $_POST["ID2_place"];
$ID3_place = $_POST["ID3_place"];
$IDX_place = $_POST["IDX_place"];
There can be unlimited variables with same name with and AI, and I have around 10 vars like that.
How can I count by the var partial name? or Is there a better way to get those _POST? I´m using a For loop.
I was using the same name and counting in the array. It worked, but I have 3 fields with radio and 2 with checkbox, and in the array all the vars of the same name merge. So the array for food have entries from all food checkbox from the field. Does that make sense?
So in one $ID1_place = string I might have $ID1_check = array
Thanks for the help. I´know there is a easy way, but I think I´m searching the wrong way since I found nothing.
Thanks a lot. regards