Re: A tricky little problem

From: Date: Thu, 15 Jun 2006 23:45:20 +0000
Subject: Re: A tricky little problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-238121@lists.php.net to get a copy of this message
On Thu, June 15, 2006 4:30 am, Ross wrote: > I have a multiple choice quiz where the questions & answers are > extracted > from an external file > > $q1 = "what is the capital of Scotland "; $a1 = "Edinburgh"; $b1 > ="Glasgow"; > $c1 ="dundee"; $d1 ="Stirling"; $q1_answer = $a1; > $q2 = "what is the capital of France"; $a2 = "Lyon"; $b2 > ="Paris"; $c2 > ="Carcassonne"; $d2 ="Madrid"; $q2_answer = $b1; > > ?> > > These are fed into a page which displays the questions and displays a > radio > button to select the answer, the page is incremnted when a correct > answer is > given > > if ($_POST['x']== $q1_answer) { > $incrementedPage = $page + 1; > header("Location: evaluation.php?page=$incrementedPage"); > } > > but how can I insert and compare the next question? $q = ${'q'.$_GET['page']}; echo $q; -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#238121) next »