| 
require_once('funcs.php');
$dir    = '../inc/';
if ( isset($_POST['f']) ) {
	$filetowrite=$dir.basename($_POST['f']);
};
if ( isset($_GET['f']) ) {
	$filetoread=$dir.basename($_GET['f']);
};
if ( isset($_POST['maintext']) && isset($_POST['submit']) && (is_file($filetowrite)) && (is_writable($filetowrite)) ) {
	$fw = fopen($filetowrite, "w");
	$text2write = html_entity_decode($_POST['maintext']);
	$text2write = str_replace(""," plz stop this ",$text2write);
	$text2write = str_replace("<%"," plz stop this ",$text2write);
	$text2write = str_replace("script"," plz stop this ",$text2write);
   	fwrite($fw, $text2write);
    fclose($fw);
};
$files = scandir($dir);
for ($i = 1; $i <= count($files); $i++) {
  	if ((strpos($files[$i],'.')!=0) && ($files[$i]!="") ) {
		echo "| Files |  \n";
	
	};
};
?>| ".$files[$i]." |  Upload files
 Exit
 | if ( ($_GET['m']==1) && (isset($filetoread)) && (is_writable($filetoread)) ) {
	print " Editing file: ".$_GET['f']."";
};
?> |