##TITLE##

##EDITABLE##
TEMPLATE; //Edit above with your preferred HTML... or use a separate file and set $templateFile //END CONFIG ======================================================================== $f = $_REQUEST['f']; //Grab the file parameter, if given $f = str_replace('..','',$f); // Security! Remove attempt to cross directories... if (strpos($f,$extension) != strlen($f)-strlen($extension)) $f .= $extension; //...and always add (safe) extension if ($_REQUEST['save']) { //SAVE REQUESTED: write page and go there if ($_REQUEST['p'] != $password) { //Bad password, so... sleep(2);die("

INCORRECT PASSWORD

"); //...wait 2 seconds and fail } //(The sleep is to slow down a "brute force" password cracker script) $html=str_replace('##TITLE##',$_REQUEST['t'],$template); //Insert the title into HTML $editable=stripslashes($_REQUEST['edited']); //Grab the edited HTML $html=str_replace('##EDITABLE##', "\n\n$editable\n\n",$html); $fsave = fopen($f, 'w'); //Open the file for write fwrite($fsave, $html); //Save the new HTML fclose($fsave); //Close the file... header("Location: $f"); //...and go there now //==================================================================IF NOT SAVE, EDIT } else if (file_exists($f)) { //Open the file for edit $content = file_get_contents($f); //Grab the file content into $content preg_match('|(.*)|Ui',$content,$match); $title = $match[1]; //Grab the title from the file preg_match('|(.*)|Us',$content,$match); $editable = $match[1]; //Grab the editable HTML from the file } //Not a Save, so show form ?> Whizzywig page editor
More about this free editor at unverse.net. Affordable, supreme hosting at Jorogo.