Re: Online Quizz
| From: | Ignacio Vazquez-Abrams | Date: | Wed, 15 Nov 2000 23:12:00 +0000 |
| Subject: | Re: Online Quizz | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-25540@lists.php.net to get a copy of this message | ||
On Wed, 15 Nov 2000, Bravo, David (CORP, MTC) wrote:
> I'm writing the code for an application to answer Quizzes online.
> It's based on the extras-phpPoll
> I think I'm finishing...
> I need the people can't back to the question once they answered.
> Please help...
> My promise is to post the source code once it's finished...
> thank you
>
Use sessions and do something like this:
Files:
index.php3 (or whatever)
q1.inc
q2.inc
...
bounce.php3 (or whatever)
mark.php3 (or whatever)
index.php3:
<?php
// Register $qnum
if (!isset($qnum))
$qnum=1;
include("q$num.inc");
?>
**EOF
q1.inc:
(HTML content goes here)
<form method="post" action="bounce.php3">
(HTML content goes here)
<input type="submit" name="Final Answer!">
(HTML content goes here)
</form>
(HTML content goes here)
**EOF
q2.inc: Similar to q1.inc
bounce.php3:
<?php
// Register $qnum
// Deal with answers here via $HTTP_POST_VARS
$qnum++;
if $qnum>NUMBER_OF_QUESTIONS
header("Location: mark.php3") // or whatever
else
header("Location: index.php3") // or whatever
?>
**EOF
mark.php3: Umm...
What happens? It's the same page (index.php3) so the B/F buttons never
become active, and the bounce.php3 makes sure that Navigator doesn't cack
on the fact that it would be the same page posted to otherwise. Plus,
reload doesn't do anything either!
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>