This should be easy, but I'm not getting it. I'm developing registration forms for a conference. I query the user (presumably a parent) to see how many forms they need for their kids. They give me a number -- say 3. I want to present them with the first form, then when they click submit, present them with the second, then they click submit and I present them with the last one. My idea is that with each click, I build a sql statement ($sql1, $sql2, $sql3) and then when the parent has finished registering each child, they click a final button that essentially runs all the queries to enter the data in the DB. I can't figure out the logic -- been trying to write pseudo code for it for the past 3 hours. The parts that are stumping me are:
(Don't laugh) I can't figure out how to present the forms one at a time. I can present all 3 at once, but that's not what I want.
I don't know how to generate the variable names of the sql statements so they have 1, 2 or 3 at the end. I know I can have some kind of index that decrements on each submit click, but how do you add that number to the end of the variable name to come up with $sql1, $sql2, $sql3. Is that possible? If not, how else could this be done?
Any help would be much appreciated -- pseudo code, real code, whatever. I'm stumped.