Advertisement
Guest User

zad1wynik1 GRACZOL

a guest
Jan 24th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. zad 1
  2.  
  3. --------------------------------------------------------
  4.  
  5. <!DOCTYPE html>
  6. <html lang="en">
  7. <head>
  8. <meta charset="UTF-8">
  9. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  10. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  11. <title>Zadanie 1</title>
  12. </head>
  13. <body>
  14. <h1>Zadanie 1</h1><hr>
  15. <p>Program odpowiada czy rok jest przestepny na podstawie daty.</p>
  16. <form action="wynik1.php" method="post">
  17. Podaj rok: <input type="text" name="rok"> <br>
  18. <input type="submit" value="Wyslij">
  19.  
  20.  
  21. </form>
  22.  
  23. </body>
  24. </html>
  25.  
  26.  
  27. ---------------------------------------------------------------------
  28. wynik1
  29. -----------------------------------------------------------------
  30. <?php
  31. $rok = $_POST['rok'];
  32.  
  33.  
  34. if(($rok%4==0 && $rok%100!=0) || $rok%400==0)
  35. echo "Rok ".$rok."jest przestepny.<br>";
  36. else
  37. echo "Rok ".$rok." nie jest przestepny.<br>";
  38. ?>
  39. -------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement