Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>cal</title>
- </head>
- <body>
- <form>
- how old are you: <input type="number" name="age" />
- <input type="submit" value="Enter" />
- </form>
- <?PHP
- $age=$_GET['age'];
- $correct=false;
- if ($age) {
- echo "you are $age years old <br />";
- if (($age>=0) && ($age<13)) {
- echo "si dieta";
- $correct=true;
- }
- if (($age>="13") && ($age<18)) {
- echo "si teenager";
- $correct=true;
- }
- if (($age>=18) && ($age<65)) {
- echo "si dospeli";
- $correct=true;
- }
- if (($age>=65) && ($age<120)) {
- echo "si stary a na dochodku";
- $correct=true;
- }
- if (($age>="120") && ($age<99999999999999999999999999999999999)) {
- echo "si davno mrtvy";
- $correct=true;
- }
- }
- if ($correct==false) {
- echo "dal si zle cislo alebo si vymyslas";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment