Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo "<html><head><title>Calculator Game From 1998</title></head><body>";
- echo "<h1>Please Guess The Answer</h1>";
- echo "<form name = "myfirstform" action = "formprocess.php" method = "POST">";
- echo "Enter Integer Between 1-5<br>";
- echo "<input type = "text" name = "firstdata">";
- echo "<br> <input type= "submit" value = "submit">";
- echo "</form>";
- echo "</body></html>";
- ?>
- <?php
- $random = rand(1, 5);
- echo "<html><head><title>Answer</title></head><body>";
- if ($_POST["firstdata"] == $random){
- echo "<h1><font color="green">Congrulations!</h1></font><br>";
- echo "<h2>Answer was: </h2>";
- echo $random;
- echo "<br>";
- echo "<a href="try.php">new game</a>";
- }
- else{
- echo "<h1><font color="red">Nope wrong answer</h1></font><br>";
- echo "<h2>Answer was: </h2>";
- echo $random;
- echo "<br>";
- echo "<a href="try.php">new game</a>";
- }
- echo "</body></html>";
- ?>
- $win=0
- $lost=0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement