i tryed this editor and its fantastic
but i have an erorr in the out put
this is the code of using it
<?
$file_dir="_samples/php"; // DIRECTORY YOU WISH TO VIEW AND EDIT THE FILES IN
$f_types=array("php","html","txt"); // FILE TYPES YOU WISH TO BE ABLE TO EDIT
if(!isset($action))
{
$dir=opendir($file_dir);
while ($file=readdir($dir))
{
if ($file != "." && $file != "..")
{
echo "<a href=".$file_dir."/".$file." target=_blank>".$file."</a>";
$extension=substr($file,-3);
$extension2=substr($file,-4);
for($x=0;$x < count($f_types); $x++)
{
if($extension == $f_types[$x] || $extension2 == $f_types[$x])
{
echo " | <a href=".$_SERVER['PHP_SELF']."?action=edit&file=".$file_dir."/".$file.">EDIT</a>";
}
}
echo "<br>";
}
}
}
else if($action == "edit")
{
$fp=fopen($file, "a+");
echo "<form action=".$_SERVER['PHP_SELF']."?action=update&file=".$file." method=post>";
include("fckeditor.php") ;
//echo "<textarea rows=20 cols=60 name=newcontent>";
$data="";
while (!feof($fp))
{
$data.=fgets($fp, 900);
//echo $data;
}
$data=stripslashes($data);
$oFCKeditor->BasePath = '/FCKeditor/' ; // '/FCKeditor/' is the default value.
$sBasePath = $_SERVER['PHP_SELF'] ;
$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
$oFCKeditor = new FCKeditor('newcontent') ;
$oFCKeditor->BasePath = $sBasePath ;
$oFCKeditor->Value = $data ;
$oFCKeditor->Create() ;
$data = $oFCKeditor->CreateHtml() ;
echo "<br><input type=submit value=Update></form>";
fclose($fp);
}
else if($action == "update")
{
$fp=fopen($file, "w");
$new_content=$_POST['newcontent'];
fwrite($fp,$new_content);
fclose($fp);
echo "Updated successfully.<br><br><a href=".$_SERVER['PHP_SELF'].">Return</a>";
}
?>
the out put of editing the file coming like that
<h1><font face=\"\\"\\\\"Tahoma\\\\"\\"\" color=\"#990000\">hello world</font></h1>
how can i remove the slashes and make it html code because when put this code in html files it will give green color but 990000 is red
best wished