hello
first i speak french then excuse me for my english..
i use fckeditor with php and i can load my text file without problem. But when i would like to save the contebt in my text file whitout use post (because i dont want a new page) it doesnt work.
its my code:
<?php
include("../fckeditor.php") ;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Editor</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div id="xToolbar"></div>
<hr />
<?php
include "load_entete.php";
$sValue= stripslashes($sValue);
?>
<?php
function getEditorValue()
{
echo '<p>save content</p>';
$sValue = addslashes($_REQUEST['FCKeditor1']);
$myFileName = "scripts/general.txt";
$fp = fopen ("$myFileName", "w+");
fwrite($fp, $sValue);
fclose($fp);
}
?>
<form method="post">
<?php
$sBasePath = 'http://localhost/test/cpanel/';
$oFCKeditor = new FCKeditor('FCKeditor1') ;
$oFCKeditor->BasePath = $sBasePath ;
$oFCKeditor->Config['SkinPath'] = 'http://localhost/test/cpanel/editor/skins/office2003/' ;
$oFCKeditor->ToolbarSet = 'GeneralEntete';
$oFCKeditor->Height = 100 ;
$oFCKeditor->Config['ToolbarLocation'] = 'Out:xToolbar' ;
$oFCKeditor->Value = $sValue;
$oFCKeditor->Create() ;
?>
<input type="button" value="Enregistrer" onClick="getEditorValue()"/>
</form>
</body>
</html>
my function not work when i call getEditorValue() in my button. i have test to simply echo and not work...
can you help me please?
i also test with
var $fcktext = FCKeditorAPI.GetInstance('FCKeditor1') ;
var $fcktext2 = fcktext.GetXHTML());
but in php dont work.... error :
Parse error: parse error in C:\wamp\www\test\cpanel\gestion\contenu\test4.php on line 23
thanks a lot
Mon, 03/16/2009 - 14:16
#1