Ciao.
Ho queste due pagine, sono solo prove
Pagina del form form.htm
pagina di riepilgo elabora_form.phpcodice:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Documento senza titolo</title> </head> <body> <form name="modulo" action="elabora_form.php" method="post"> <table> <tr> <td>Nome utente:</td><td><input type="text" name="nome" size="20"></td> </tr> <tr> <td>Indirizzo email:</td><td><input type="text" name="indirizzo" size="20"></td> </tr> <tr> <td>Motivo del contatto:</td> <td> <select name="motivo"> <option value="commerciale">Informazioni commerciali</option> <option value="preventivo">Richiesta preventivo</option> <option value="appuntamento">Prenotazione appuntamento</option> </select> </td> </tr> <tr> <td>Note:</td><td><textarea name="testo" cols="20" rows="7"></textarea></td> </tr> <tr> <td colspan="2" align="center"><input type="submit" value="Invia email"></td> </tr> </table> </form> </body> </html>
Quando compilo il form e lo invio, si apre la pagina elabora_form.php e invece stanamente di visualizzare il valore delle variabili passate mi visualizza questi errori:codice:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Documento senza titolo</title> </head> <body> Riepilogo campi: <?php echo "nome: $nome "; echo "indirizzo: $indirizzo "; echo "motivo del contatto: $motivo "; echo "testo inserito: $testo"; ?> </body> </html>
Dovè l'errore? A me il codice sembra giusto!codice:Riepilogo campi: Notice: Undefined variable: nome in C:\Programmi\EasyPHP5.3.0\www\lezione7\elabora_form.php on line 11 nome: Notice: Undefined variable: indirizzo in C:\Programmi\EasyPHP5.3.0\www\lezione7\elabora_form.php on line 12 indirizzo: Notice: Undefined variable: motivo in C:\Programmi\EasyPHP5.3.0\www\lezione7\elabora_form.php on line 13 motivo del contatto: Notice: Undefined variable: testo in C:\Programmi\EasyPHP5.3.0\www\lezione7\elabora_form.php on line 14 testo inserito:
Grazie Ciao

Rispondi quotando

