Buongiorno. Si tratta di un semplice modulo per i commenti. Il testo dei commenti, inviato tramite un form, viene archiviato nel file comments.html. Il problema sono le parole accentate che creano simboli di errore (come questi è Ã) che aumentano fino a creare lunghe file ad ogni accesso al file comments.html. Come posso rimediare? Grazie per l'aiuto.
Il codice è questo:
Il codice è questo:
PHP:
if ($_POST){
$name = $_POST['name'];
$date = new DateTime();
$date = $date->format("d.m.y - h:i:s");
$content = $_POST['message'];
$handle = fopen("comments.html","a");
fwrite ($handle
,"<p><span style='color:red; background-color:transparent; font-weight:bold; font-size:12pt;'>" . $name . "</span><br>"
. $date . "<br><em>"
. $content . "</em></p><hr>\r\n");
fclose ($handle);
header("location: ./comments-form.html");
}
?>