Guest User

About your age

a guest
Oct 2nd, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>cal</title>
  4. </head>
  5. <body>  
  6.     <form>
  7.     how old are you: <input type="number" name="age" />
  8.     <input type="submit" value="Enter" />
  9. </form>
  10.   <?PHP
  11.     $age=$_GET['age'];
  12.     $correct=false;
  13.     if ($age) {
  14.         echo "you are $age years old <br />";
  15.         if (($age>=0) && ($age<13)) {
  16.           echo "si dieta";
  17.           $correct=true;
  18.         }
  19.         if (($age>="13") && ($age<18)) {
  20.           echo "si teenager";
  21.           $correct=true;
  22.         }
  23.  
  24.         if (($age>=18) && ($age<65)) {
  25.           echo "si dospeli";
  26.           $correct=true;
  27.         }    
  28.        
  29.         if (($age>=65) && ($age<120)) {
  30.           echo "si stary a na dochodku";
  31.           $correct=true;
  32.         }
  33.          
  34.         if (($age>="120") && ($age<99999999999999999999999999999999999)) {
  35.           echo "si davno mrtvy";
  36.           $correct=true;
  37.         }  
  38.    }
  39.    
  40.    if ($correct==false) {
  41.     echo "dal si zle cislo alebo si vymyslas";
  42.    }
  43.    
  44.   ?>
  45. </body>
  46. </html>
Advertisement
Add Comment
Please, Sign In to add comment