keenemaverick Posted December 18, 2006 Share Posted December 18, 2006 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 More sharing options...
Cep Posted December 18, 2006 Share Posted December 18, 2006 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. Link to comment https://forums.phpfreaks.com/topic/31068-solved-multi-page-form/#findComment-143480 Share on other sites More sharing options...
JasonLewis Posted December 18, 2006 Share Posted December 18, 2006 you dont have to use session variables. you could just store them in hidden input fields.[code]<input type="hidden" name="blah" value="avalue">[/code] Link to comment https://forums.phpfreaks.com/topic/31068-solved-multi-page-form/#findComment-143488 Share on other sites More sharing options...
keenemaverick Posted December 18, 2006 Author Share Posted December 18, 2006 I kinda figured that's what I'd have to do. Thanks! Link to comment https://forums.phpfreaks.com/topic/31068-solved-multi-page-form/#findComment-143493 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.