Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function initialQuestion() {
- global $row;
- $r = array_rand($row);
- echo $row[$r][0];
- echo "<form action='' method='post'>";
- echo '<input type="submit" name="Answer1" onclick="" class="Answer" value="'.$row[$r][1].'"><br>';
- echo '<input type="submit" name="Answer2" onclick="" class="Answer" value="'.$row[$r][2].'"><br>';
- echo '<input type="submit" name="Answer3" onclick="" class="Answer" value="'.$row[$r][3].'"><br>';
- echo "</form>";
- unset($row[$r]);
- echo count($row);
- echo "<br>";
- global $points;
- global $answer1;
- global $answer2;
- global $answer3;
- if (isset($_POST["Answer1"])){
- echo("You pressed answer 1");
- $points = $points + $answer1;
- echo("<br> You scored $points points");
- initialQuestions();
- echo("<br> ----------------------<br>");
- }
- else if (isset($_POST["Answer2"])){
- echo("You pressed answer 2");
- $points = $points + $answer2;
- echo("<br> You scored $points points");
- initialQuestions();
- echo("<br> ----------------------<br>");
- }
- else if (isset($_POST["Answer3"])){
- echo("You pressed answer 3");
- $points = $points + $answer3;
- echo("<br> You scored $points points");
- echo("<br> ----------------------<br>");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement