Location: PHPKode > projects > Peardrop CMS > peardrop/inc/edit.inc.php
<?php
//get the page id from the url
$file = $_GET['f'];
$type = $_GET['t'];

//If blank load the home page
if ( $file == NULL ) {
echo("New File");
print("
	<form action=\"admin.php?savedata=1\" method=\"post\">
		<p>
			Page Name:<br />
			<input type=\"text\" name=\"FileName\" value=\"$file\">
			<input type=\"radio\" name=\"type\" value=\"content\" />Listed
			<input type=\"radio\" name=\"type\" value=\"hidden\" />Hidden
			<textarea id=\"editor1\" name=\"editor1\"></textarea>
			<script type=\"text/javascript\">
				CKEDITOR.replace( 'editor1' );
			</script>
		</p>
		<p>
			<input type=\"submit\" />
		</p>
	</form>
");	
} else {
//Check that the page id has no illegal expressions
if (strstr($file, "/")) {
$file = NULL; //re-write $home to the static home page
}
if (strstr($file, ":")) {
$file = NULL; //re-write $home to the static home page
}
if (strstr($file, ".")) {
$file = NULL; //re-write $home to the static home page
}
if (strstr($type, "/")) {
$type = NULL; //re-write $home to the static home page
}
if (strstr($type, ":")) {
$type = NULL; //re-write $home to the static home page
}
if (strstr($type, ".")) {
$type = NULL; //re-write $home to the static home page
}
$output = file_get_contents("$type/$file");
print("
	<form action=\"admin.php?savedata=1&t=$type\" method=\"post\">
		<p>
			Page Name:<br />
			
			<input type=\"text\" name=\"FileName\" value=\"$file\">
			<textarea id=\"editor1\" name=\"editor1\">$output</textarea>
			<script type=\"text/javascript\">
				CKEDITOR.replace( 'editor1' );
			</script>
		</p>
		<p>
			<input type=\"submit\" />
		</p>
	</form>
");
}
include('inc/editor-files.inc.php');
?>
Return current item: Peardrop CMS