Advertisement
kklevi

Untitled

Oct 4th, 2022
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <head>
  5. <meta charset="UTF-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>Document</title>
  9. </head>
  10.  
  11. <body>
  12. <?php
  13. session_start();
  14.  
  15. ?>
  16. <form method="post" name="szam">
  17. <input type="number" name="szaminput">
  18. <input type="submit" value="elküld">
  19.  
  20. </form>
  21. <?php
  22. echo '<a href="?ujra=igen">újraszám</a>';
  23. $_SESSION['randomszam'] = rand(0, 100);
  24. echo $_SESSION['randomszam'];
  25. echo '<br>';
  26. if ($_POST['szaminput'] == $_SESSION['randomszam']) {
  27. echo 'helyes';
  28. } else if ($_POST['szaminput'] < $_SESSION['randomszam']) {
  29. echo 'nagyobb számot kérek';
  30. } else if ($_POST['szaminput'] > $_SESSION['randomszam']) {
  31. echo 'kisebb számot kérek';
  32. }
  33. ?>
  34. </body>
  35.  
  36. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement