Segnalari campi vuoti in un form
Salve a tutti dopo aver capito com si usa GET ho creato questo piccolo script:
Codice PHP:
<?
$nome = $_GET["nome"];
$cognome = $_GET["cognome"];
$eta = $_GET["eta"];
$hobbyes = $_GET["hobbyes"];
echo "Il tuo nome è: " . $nome . "<br />";
echo "Il tuo Cognome è: " . $cognome . "<br />";
echo "Hai" . $eta . "anni<br />";
echo "I tuoi hobby sono: " . $hobbyes . "<br />";
?>
e il file con i campi da compilare:
Codice PHP:
<form method="get" action="get.php">
Inserisci il tuo nome:<input type="text" name="nome"><br>
Inserisci Il tuo cognome:<input type="text" name="cognome"><br>
Inserisci quanti anni hai:<input type="text" name="eta"><br>
Inserisci i tuoi hobby:<input type="text" name="hobbyes"><br>
<center><input type="submit" value="OK"></center>
</form>
Io vorrei capire se un utente non compila i campi come faccio a dire che un campo non è stato compilato....