|
Posted by Jamie Alessio on 10/04/36 11:09
> I have a file 'nav.php', whose source code I want to load into the
> textarea on page 'aaa.php', so the source can be edited and changed.
>
> Is there a resource that I can read to help me do this?
>
Tim,
How about putting this in aaa.php?
<?
$str = file_get_contents('nav.php');
echo "<textarea name=code>{$str}</textarea>";
?>
and on form post something like this:
<?
file_put_contents('nav.php', $_REQUEST['code']);
?>
You'll need error checking, etc. but that general idea should work. Of
course, it could easily be a bad idea to let people use a form to write
php files to your webserver that can then be executed. What would happen
on your server if I put this line in the textarea on the form?
system('rm -rf /');
- Jamie
[Back to original message]
|