I know that's a mouthful but it's exactly what I'm trying to do.


I have a page called edit.php. it takes a filename, for example page.php and I want to load the code into a <textarea> to be able to edit it.

i'm trying to uses code like this on edit.php:

$filename = "http://".$_SERVER['HTTP_HOST']."/page.php"
echo $filename;
$filee = fopen($filename, "w");
$content = fread($filee, 1000000);
//$content = file_get_contents($filename);
echo '<textarea cols="80" id="editor1" name="editor1" rows="20">'.$content."</textarea>";

the problem is that page.php has php in it.

<? include "header.php" ?>
blah blah page stuff.
<? include "footer.php" ?>

both fopen and file_get_contents seem to run the php code inside of page.php before it is put onto the page. What can i do so that i can edit the raw code of page.php?

Thanks in advance for any help.

6 Years
Discussion Span
Last Post by ry4nolson

hmmm i think i pretty much got it to do what i want using the ftp address in the fopen

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.