You have to make 2 sections...
The first, showing the content of the file:
1. Open the file
2. Use htmlentities() to convert any "special" character to &...; This way, "<" and ">" tags will be converted and you won't have trouble with the textarea
3. "Echo" the content of the file (modified).
Ex:
<TEXTAREA NAME="file" ...>
<? echo $file_content; ?>
</TEXTAREA>
Here, the file content is shown in a textarea text zone. So, a form will send datas to the secong section.
The second section, will get the datas sent by the form of the first section.
1. Use stripslashes to remove \" \' \, etc.
2. Convert &...; to "special" characters using this code:
$trans = get_html_transition_table(HTMLENTITIES);
$trans = array_flip ($trans);
$file_content = strtr ($file_content, $trans);
where $file_content is the content of the file.
3. Open the file and put the new code in it.
It should work!
Hub. Lem.