2009-04-29, 07:16 AM
Hi, I created a php script so I can remotly edit files on my server, the problem I have is that if the file I want to edit has a </textarea> the php script breaks before this and echo's the rest of the file outside of the textarea on the php script so I can't finish editing the file I want to edit.
I spent almost 3 hours today trying to fix this and failed
.
Please help, many thanks in advance
.
Screenshot of problem:
![[Image: 97196959.png]](https://camo.mybb.com/d43d44ade5cf8057ac6ad4d0e4ce98b2f33a05f7/687474703a2f2f696d673532342e696d616765736861636b2e75732f696d673532342f333838322f39373139363935392e706e67)
testFile.php
I spent almost 3 hours today trying to fix this and failed

Please help, many thanks in advance

Screenshot of problem:
<?php
$myFile = "testFile.php";
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);
?>
<form action="ef.php" method="post">
<textarea name="data" cols="40" rows="5">
<?php echo $theData; ?>
</textarea><br>
<input type="submit" value="Submit" />
</form>
testFile.php
<textarea>
lalala
</textarea>
testing