Location: PHPKode > projects > Openology PHP Application Integration > openology/backend/file_save.php
<?
require(dirname(__FILE__)."/config.php");
$activepath = str_replace("..","",$activepath);
$activepath = ereg_replace("^/{1,}","/",$activepath);
if($activepath == "/") $activepath = "";
//文件编辑
/*---------------
function __saveEdit();
----------------*/
if($action=="edit")
{
		$filename = str_replace("..","",$filename);
		$file = "$base_dir$bdir/$filename"; 
    $str = eregi_replace("< textarea","<textarea",$str);
	  $str = eregi_replace("< /textarea","</textarea",$str);
	  $str = eregi_replace("< form","<form",$str);
	  $str = eregi_replace("< /form","</form",$str);
    $str = stripslashes($str);
    $fp = fopen($file,"w");
    fputs($fp,$str);
    fclose($fp);
    header("Location: file_edit.php?action=edit&filename=$filename");
    exit();
}
//文件编辑,可视化模式
/*---------------
function __saveEditView();
----------------*/
else if($action=="editview")
{
		$filename = str_replace("..","",$filename);
		$file = "$base_dir$bdir/$filename";
	  $str = eregi_replace('&quot;','\\"',$str);
    $str = stripslashes($str);
    $fp = fopen($file,"w");
    fputs($fp,$str);
    fclose($fp);
    header("Location: file_edit.php?action=editview&filename=$filename");
    exit();
}
?>
Return current item: Openology PHP Application Integration