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

Example

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.