I am trying to read a file into a textarea to enable me to change and eventually rewrite a file...
I am using the following function
function edit_file($file) {
$handle=fopen(urldecode($file),"r+");
echo "<textarea name=filetext cols=100 rows=30>";
$i=1;
while (!feof ($handle)) {
$buffer = fgets($handle, 4096);
echo "<".$i.">".$buffer;
$i++;
}
echo "</textarea>";
fclose ($handle);
}
which does that perfectly.... UNTIL
The file I am not opening includes the code </textarea> in it (I am changing html forms via a webpage), and as a result it closes the textarea for me then spits the rest of teh file out after it.
I am stumped for a workaround for this or another way of doing it, as I can't really change the code as it comes out, as it will look wrong, and seem incorrect HTML on the screen.
Any ideas ?