Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <meta charset="UTF-8">
  5.         <title>Hi</title>
  6.     </head>
  7.     <body>
  8.         <form method="POST" action="test.php">
  9.             <input type="text" name="text" placeholder="Insert answer">
  10.             <input type="submit" name="submit" value="Submit">
  11.         </form>
  12.  
  13.         <?php
  14.         $valuegivenbycomputer = "hello";
  15.  
  16.  
  17.         if (isset($_POST["submit"])){
  18.             if ($_POST["text"] == $valuegivenbycomputer) {
  19.                 print("Correct answer!");
  20.             } else {
  21.                 print("Wrong answer!");
  22.             }
  23.         }
  24.         ?>
  25.     </body>
  26. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement