HEX
Server: Apache
System: Linux msm5694.mjhst.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: camjab_ssh (1000)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: /home/httpd/html/seekya.com/DEAD/beta/manage/editor_inc.php
<?
if (empty($_SESSION["admin"])) redirect("index.php?e=1");
if (empty($_GET["fl"])) {
	die("no file name provid1ed");
}
$fl = filterdir($_GET["fl"]);

if ($_POST["mode"] == "save") {
	$fl_data = $_POST["finaltxt"];
	$ad = split("/", $fl);
	$ad[count($ad)-1] = "";
	createrdir(filterdir(implode("/", $ad)));
	if (!$handle = fopen("data/" . $fl, "w")) {
		echo "Cannot write to file";
	} elseif (fwrite($handle, $fl_data) === FALSE) {
		echo "Cannot write to file";
	}
} elseif (!empty($fl) && $_POST["mode"] == "edit") {
	if (file_exists("data/" . $fl))
		$fl_data = file_get_contents("data/" . $fl);
	else
		echo("Invalid file");
}

/*
if ($_POST["savefile"]!=''){
	$mypath=realpath("test.php");
				$mypath=str_replace("test.php","",$mypath);
				$mypath=str_replace("\\","/",$mypath);
				
	$upload_folder =  $mypath."data/";
	// the name of the text file
	$filename = $upload_folder.$_POST["file_name"];
	
	// get the variables from flash
	$somecontent = $_POST["finaltxt"];

	// If the file doesn't exist, attempt to create it
	// and open it for writing
	// anything already writen will be replaced
	if (!$handle = fopen($filename, 'w')) {
		 echo "&message=Cannot open file&";
		 exit;
	}

	// Write $somecontent to the opened file.
	if (fwrite($handle, $somecontent) === FALSE) {
		echo "&message=Cannot write to file&";
		exit;
	}
	// close the file
	fclose($handle);

	// send the variable to flash
	//echo "&message=$somecontent&";
	echo "file saved Succefully";

}*/
?>