in reply to Simple Quiz Maker (cont.)
Since the internet is a stateless environment, you need some way of maintaining state.
The options I see for you are:
Also, a side note, instead of
The options I see for you are:
- Pass all answers through the whole app, using hidden fields.
- Drop a cookie with some sort of ID, and write the results to a text file/database. Then retrieve the data based on ID on the 3rd page.
Also, a side note, instead of
You could usemy $who = param("firstname"); my $who2 = param("lastname"); my $email = param("email"); my $firstquestion = param("FirstQuestion"); my $secondquestion = param("SecondQuestion"); my $thirdquestion = param("ThirdQuestion"); my $fourthquestion = param("FourthQuestion"); my $fifthquestion = param("FifthQuestion"); my $answerfirstquestion = param("AnswerFirstQuestion"); my $answersecondquestion = param("AnswerSecondQuestion"); my $answerthirdquestion = param("AnswerThirdQuestion"); my $answerfourthquestion = param("AnswerFourthQuestion"); my $answerfifthquestion = param("AnswerFifthQuestion"); my $useranswerfirstquestion = param("UserAnswerFirstQuestion"); my $useranswersecondquestion = param("UserAnswerSecondQuestion"); my $useranswerthirdquestion = param("UserAnswerThirdQuestion"); my $useranswerfourthquestion = param("UserAnswerFourthQuestion"); my $useranswerfifthquestion = param("UserAnswerFifthQuestion"); my $choicesfirstquestion = param("ChoicesFirstQuestion"); my $choicessecondquestion = param("ChoicesSecondQuestion"); my $choicesthirdquestion = param("ChoicesThirdQuestion"); my $choicesfourthquestion = param("ChoicesFourthQuestion"); my $choicesfifthquestion = param("ChoicesFifthQuestion");
I just think it looks a lot cleaner. It also would allow you to simplify your form output using a loop.my %cgi_data = Vars(); #Vars() is imported from CGI.pm
- Tom
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Simple Quiz Maker (cont.)
by matthewb (Curate) on Dec 06, 2003 at 04:36 UTC |
In Section
Seekers of Perl Wisdom