Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <?php
  2. echo "<html><head><title>Calculator Game From 1998</title></head><body>";
  3. echo "<h1>Please Guess The Answer</h1>";
  4. echo "<form name = "myfirstform" action = "formprocess.php" method = "POST">";
  5. echo "Enter Integer Between 1-5<br>";
  6. echo "<input type = "text" name = "firstdata">";
  7. echo "<br> <input type= "submit" value = "submit">";
  8. echo "</form>";
  9. echo "</body></html>";
  10. ?>
  11.  
  12. <?php
  13. $random = rand(1, 5);
  14. echo "<html><head><title>Answer</title></head><body>";
  15. if ($_POST["firstdata"] == $random){
  16. echo "<h1><font color="green">Congrulations!</h1></font><br>";
  17. echo "<h2>Answer was: </h2>";
  18. echo $random;
  19. echo "<br>";
  20. echo "<a href="try.php">new game</a>";
  21. }
  22. else{
  23. echo "<h1><font color="red">Nope wrong answer</h1></font><br>";
  24. echo "<h2>Answer was: </h2>";
  25. echo $random;
  26. echo "<br>";
  27. echo "<a href="try.php">new game</a>";
  28. }
  29. echo "</body></html>";
  30. ?>
  31.  
  32. $win=0
  33. $lost=0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement