Hey,
I'm working on a site that will be like neopets.com, but a open source.
I am making a Trivia game for it, so users can win money.
Well what I want to do is call results from a php file called: trivia.inc.php
This file will have questions and answers for the trivia, they will be set out like this: Question🅰b:c:d:prize
(b:c:d are the possible,answers and a is the real answer)
With the following script, what do I add to bring up a random question:
IT has to beable to know the question that was picked, so the user can check the answer
<?php
$queslist = file("trivia.inc.php");
for ($i=1; $i<count($queslist); $i++) {
list($q,$a,$b,$c,$d,$p) = explode(':',chop($queslist[$i]));
echo "$q<br><br>";
echo "<input type='radio' name='com' value='1'>$b<br>
<input type='radio' name='com' value='2'>$c<br>
<input type='radio' name='com' value='3'>$d<br>
<INPUT TYPE='hidden' NAME='level' size=10 value='1'>
<input type=hidden name='submit' value=' Set '>
<input type=submit Value=Submit>";
}
?>
The current script above desplays all the questions only,
If the user gets the right answer, i will need to beable to submit the the users details in a different file to add the prize