I have a small problem displaying html source into a textarea. I read the code in from a file and display it with no problems. However, if the page that I am reading from has a textarea in it then that textarea ends my textarea tag and interprets the remainder of the html form. Below is an example of my code. I am building a file manager much like geocities, so any other methods of doing this would be appreciated.
$filename = "$upload_directory$file_name";
$fd = fopen ($filename, "rb");
$contents = fread ($fd, filesize ($filename));
<textarea name=\"source\" cols=\"75\" rows=\"50\" wrap=\"virtual\">$contents</textarea>