Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- form with dynamic questions
October 7, 2006, 2:51 am
rate this thread
I've a mysql table where i stored a list of questions. My php script
executes a query which yields a different number of questions every time; i
used the loop function to create an input field for each question in the
form; and dynamically referencing each input name with the question number
i.e. question 1 is called q1, question 2 named q2, and so on.
The data is submitted using POST. I then try to retrieve all the answers by
doing a loop and using something like echo '$_POST['q'.$n.'']'; except the
syntax doesnt seem to work.
Can anyone please tell me what am doing wrong - or a better way of doing