header("content-type:text/html;charset=utf-8");
$conn=@mysql_connect("localhost","root","123");
mysql_select_db("test");
mysql_query("set names utf8");
$con=$_POST['con'];
if($con!=""){
$sql="insert into fckedit (content) values('$con')";
mysql_query($sql);
}
?>
//验证fck内容是否为空
function check(){
//取fckeditor的内容
var con=FCKeditorAPI.GetInstance('con').GetXHTML(true);
if(con==""){
alert("不能为空");
return false;
}else
{
return true;
}
//为fckeditor设置内容
FCKeditorAPI.GetInstance('con').SetHTML("没问题了");
return false;
}
include("FCKeditor/fckeditor_php5.php");
$ed=new FCKeditor('con');
$ed->BasePath='FCKeditor/'; //告诉你fck所需要的文件路径
$ed->ToolbarSet='Default';
$ed->Value="这是默认值";
$ed->Width='50%';
$ed->Height='300px';
$ed->create();
?>