Ciao a tutti,
siccome devo inserire del codice html in uno script per comodità vorrei usare la sintassi eredoc ma ho un problema, la cosa che vorrei scrivere e poi stampare è la seguente variabile:
Codice PHP:
$html = <<<html
<form id="prova_form" name="prova_form" method="post" action="iscrizione.php">
<table width="500" border="0">
<tr> <td width="128">Username</td> <td width="362"><label for="nome_utente"></label> <input name="nome_utente" type="text" id="nome_utente" tabindex="1" value="" /></td> </tr>
<tr> <td>Password</td> <td><label for="parola_chiave"></label> <input name="parola_chiave" type="password" id="parola_chiave" tabindex="2" value="" /></td> </tr>
<tr> <td>Email</td> <td><label for="email"></label> <input name="email" type="text" id="email" tabindex="3" value="" /></td> </tr>
<tr> <td></td> <td><input type="submit" name="invia" id="invia" value="Invia" /></td> </tr> </table> </form>
html;
quando vado ad eseguire lo script ho questo errore:
Parse error: syntax error, unexpected $end, expecting T_VARIABLE or T_END_HEREDOC or T_DOLLAR_OPEN_CURLY_BRACES or T_CURLY_OPEN in C:\xampp\htdocs\PHP\iscrizione\iscrizione.php on line 72
la riga 72 è </html>
?>
</body>
</html>
sapete dirmi quale errore commetto?
la sintassi come viene spiegata su php.net mi pare esatta.
spero possiate aiutarmi.
grazie