Originariamente inviato da nicola75ss
Visto che la tua textarea è scritta così con i backslash

<TEXTAREA ROWS=\"5\" COLS=\"35\" NAME=\"testo01\" onKEYUP=\"conta(this.form)\"></TEXTAREA>

immagino che sia tutta all'interno di un echo giusto?
Il testo ti viene visualizzato correttamente a parte il problema delle barre prima degli apici?
Si.

Ti allego il tutto

IF ($id == "02"){
echo "
<SCRIPT>
function conta(val) {
max=250
if (val.testo01.value.length > max) {
val.testo01.value = val.testo01.value.substring(0,max)
rest = 0
}
else {
rest = max - val.testo01.value.length
}
val.num.value = rest
}
</SCRIPT>
<form method=\"post\" action=\"$PHP_SELF?id=02bis\" enctype=\"multipart/form-data\">
<H4>Testo Galleria 01</H4>
Testo
<TEXTAREA ROWS=\"5\" COLS=\"35\" NAME=\"testo01\" ONKEYUP=\"conta(this.form)\"></TEXTAREA>
<INPUT VALUE=\"250\" NAME=\"num\" SIZE=\"4\" DISABLED>
<input type=\"submit\" value=\"Testo\"</form>


testo attuale:
";
include "galleria/testo01.txt";
}

IF ($id == "02bis"){
$testo = 'galleria/testo01.txt';
$testo = stripslashes("$testo"); //questo lo aggiunto ora ma . . .
$file = fopen($testo, 'w');
fwrite($file, $testo01);
echo "
<META HTTP-EQUIV=Refresh CONTENT=\"2; URL=protetta.php?id=02\">
sostituzione testo 01 in corso . . .
";
}