Jump to content

[SOLVED] Multi-page form..?


keenemaverick

Recommended Posts

Hey everyone,

I'm designing an IQ test, and I have a form with 222 questions on it. My processing script pulls all the questions and calculates the score through $_POST. The thing is, one page with 222 questions is pretty intense. I'd rather split the page into about 10-12 pages of 20-22 questions each.

Is there a way to split this form that'll keep all the results in $_POST so I can process it the same way?

This is the way I'm pulling it all right now:

[code]$numquestions = count($_POST) -7;
for ($i = 1, $i <=$numquestions, i++) {
$correctanswers[] = $_POST[q$i];
}[/code]
Link to comment
https://forums.phpfreaks.com/topic/31068-solved-multi-page-form/
Share on other sites

No there is not unless you write the information back to a database, which is not a very good method for what your doing.

The best approach would be to say, submit 1 - 50 questions on page 1, collect them with POST and then assign them to session variables and pass these from page to page until your final script at the very end.

Alternatively if you are not going to display which ones the user got right or wrong you could collect 1 - 50 questions on page 1 using POST, work out the number they got correct, say 29 and pass that as a session variable to the next form and so on till it reaches your end script and then you can tally up the numbers.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.