1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<!doctype html> <html lang="it"> <head> <title>ETA'</title> <meta charset="utf-8" /> </head> <body> <form action="elabora.php" method="post"> <label>Età:</label><br /> <input type="text" name="eta" required /> <br /> <input type="submit" value="INVIA"> </form> </body> </html> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<?php header('Content-type: text/html; charset=utf-8'); echo "<a href='index.html'>Home</a><br /><br />"; $eta=$_POST["eta"]; if($eta>17) $msg="MAGGIORENNE"; else $msg="MINORENNE"; echo "Ciao ... <br /> La tua età è: $eta <br />Sei $msg"; ?> |