Guest User

Untitled

a guest
Jan 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. if(!isset($_POST['guess']) && !isset($_SESSION['rand'])) {
  2. $_SESSION['rand'] = rand(1,100);
  3. $_SESSION['counter'] = 0;
  4. ?>
  5.  
  6. <h4 style="text-align:left;">I'm thinking of a number between 1 and 100. What is it?</h4>
  7. <form action="guess.php" method="post">
  8. What's your guess?<br /><input type="text" id="guess" name="guess" /><br />
  9. <input type="submit" value="Submit Guess" />
  10. </form>
  11. <?php
  12. $_SESSION['guess'] = $_POST['guess'];
  13. } else {
Add Comment
Please, Sign In to add comment