Advertisement
ini_PlayeR

8D_How to Calculate The Age Status

Mar 17th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. <html>
  2.     <head>
  3.     <title>If Statemenet</title
  4.     </head>
  5. <body>
  6. <form method = "get" action = "" >
  7.     Usia <input type = "text" name = "usia" /></br>
  8.     <input type ="submit" name="submit" value="submit" />
  9.     <input type="reset" name="reset" value="reset" /></br>
  10. <?php
  11. echo "Usia : ".$usia = $_GET[usia]." tahun </br>";
  12. if ($usia == " ")
  13. {
  14.     echo "Harap Memasukkan Keterangan Usia";
  15. }
  16. else
  17. {
  18.     if ($usia >=0 && $usia <= 5)
  19.     {
  20.         echo "Status : BALITA";
  21.     }
  22.     else if ($usia >= 6 && $usia <=16)
  23.     {
  24.         echo "Status : Anak-anak";
  25.     }
  26.     else if ($usia >= 17 && $usia <=25)
  27.     {
  28.         echo "Status : REMAJA";
  29.     }
  30.     else if ($usia >= 26 && $usia <=50)
  31.     {
  32.         echo "Status : DEWASA";
  33.     }
  34.     else if ($usia >50)
  35.     {
  36.         echo "Status : TUA";
  37.     }
  38. }
  39. ?>
  40. </form>
  41. </body>
  42. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement