0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
admin
/
pages
/
[
Home
]
File: editor.php
<?php //require('../../style.css'); $page=$_GET['edit']; if($page=="index") { $head="Home"; } else { $head=$page; } ?> <link href="../style.css" rel="stylesheet" type="text/css"> <link href="../css/admin-style.css" rel="stylesheet" type="text/css"> <span class="left-links"><font color="#990000">You are Editing <?=$head?> Page <br> <? $filename = "../pages/".$page.".php"; //chmod($filename, 0755); if(isset($_POST['submit'])) { //save the content into the file if (!$handle = fopen($filename, 'w')) { echo "Cannot open file ($filename)"; exit; } if (fwrite($handle, stripslashes ($_POST[$page])) === FALSE) { echo "Cannot write to file ($filename)"; }else{ echo "Page updated Successfully..."; } fclose($handle); }else{ ?> </font></span> <center><form action="" method="POST"> <?php include("FCKeditor/fckeditor.php") ; ob_start(); $oFCKeditor = new FCKeditor($page) ; $oFCKeditor->BasePath = 'FCKeditor/' ; $oFCKeditor->Height = 500 ; $oFCKeditor->Width = "90%" ; $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); fclose($handle); $oFCKeditor->Value = $contents ; $oFCKeditor->Create() ; $out1 = ob_get_contents(); ob_end_clean(); echo $out1; ?> <div align="center"> <input type="submit" name="submit" value="Save"/> </div> </form></center> <?php } ?>