Hi all, I have a problem that has me baffeled.
I have a page that asks a user to enter a number into a textfield. The number he enters will be the number of Questions. This then goes to the next page that has Dynamically created textfields based on the number the user entered. SO if he entered 3 there would be 3 textfields.
Now each textfield is named like "answers1", "answers2","answers3" etc...
In these textfields the user will enter another set of numbers for the number of answers each question will have.
For example: He entered 3 in the first textfield which means there are 3 questions, he now has 3 textfields in front of him where he will enter the number of answers for each question.
So if he entered 2 into the first textfield and 5 into the second textfield and 3 into the third textfield and then clicks the submit button it should take him to the next page and display textfields like this
Question1
Answer1
Answer2
Question2
Answer1
Answer2
Answer3
Answer4
Answer5
Question3
Answer1
Answer2
Answer3
Now my problem is, I know how many questions the user chose so I know how many textfields are being Posted to the next page in this case it would be 3 and I know the name of those textfields "answers1", "answers2","answers3" but how do I get the values of those textboxes?
I can't manualy harcode it to say $NumAnswers = $_POST[Answers1] because there could be any number of textfields. And I cant do a For loop and append the number onto the word Answers because that doesn't seem to work.
I remember there is some sort of PHP command to get the array of posted variables but I can't remember what it's called and I'm not sure that would work.
Any help is appreciated! Thanks! 😃