Mike
Active Members
This very small script will let you open another file into a text editor, edit it, and then you can save it (pretty much what vBulletin uses in the AdminCP for template editing).
This is mostly for future reference for me, since I'm still working on my forum software (slowly). But if anyone else needs it, feel free to use it (my forum software will be free and open source, therefore I will occasionally post snippets of useful code here for people).
Just change the red text to the URL of the page you want to edit and you're all set.
This is mostly for future reference for me, since I'm still working on my forum software (slowly). But if anyone else needs it, feel free to use it (my forum software will be free and open source, therefore I will occasionally post snippets of useful code here for people).
Code:
<?php
if(isset($_POST['submit']))
{
$file = "[color="Red"]url[/color]";
$handle = fopen($file, 'w');
$data = stripcslashes($_POST['string']);
fwrite($handle, $data);
print "Changes Saved...";
fclose($handle);
}
$file = "[color="Red"]url[/color]";
$data = file_get_contents($file);
?>
<form action="<? echo $_SERVER['PHP_SELF']; ?>" method="post">
<textarea name="string"><? echo "$data"; ?></textarea>
<input name="submit" type="submit" value="Submit">
</form>