PX : code

FilEd by Steven Chalker
Download this code


<?
if($try == \'edit\') {
$fp=fopen($file, \'r\') or die(\"Adjust in FTP to Readable\");
echo \'<title>Editing $file</title>\\n\';
echo \'<form action=\'$PHP_SELF?try=save&file=$file\' method=post>\\n\';
echo \'Editing $file<BR>\';
echo \'<textarea rows=\'20\' cols=55 name=msgt>\';
echo fread($fp, filesize($file));
echo \'</textarea><br>\';
echo \'<input type=submit value=Save>\';
fclose($fp);
} elseif($try == \'save\') {
$fd=fopen($file, \"w\") or die(\"Adjust in FTP to Writable\");
fwrite($fd, $msgt);
fclose($fd);
header(\"Location: $PHP_SELF?\");
} else {
$dir=dir(getcwd());
echo \'<TABLE BORDER=0>\\n\';
echo \'<tr><td>Edit File:</td></tr>\\n\';
while($file = $dir->read()) {
echo \'<tr><td><a href=\'$PHP_SELF?try=edit&file=$file\'>$file</a></td></tr>\\n\';
}
}
?>

Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.