Codice PHP:
$testo htmlspecialchars($_POST['text']); 
Prova cosi...dovrebbe sostituirtelo con & quot; che poi dovrebbe essere correttamente reinterpretato nella pagina html.