现在的位置: 首页 > 综合 > 正文

fckediter 在php中的运用

2012年03月14日 ⁄ 综合 ⁄ 共 893字 ⁄ 字号 评论关闭
在 index.php 文件中,调用它的代码,把下面的代码加在需要编辑器的地方:

<?php 
$fck = $_POST [ "FCKeditor" ] ;
if ( $fck != "" ) 

echo htmlspecialchars ( $fck ) ;

?> 

<html>
<head>
<title>fck测试<title>
 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<form action="index.php" method="POST">
      
<?php
        //引用FCKeditor.php这个文件,基本的类和数据结构都在这里
        include_once("FCKeditor/fckeditor.php");
        //创建FCKeditor对象的实例。myFCKeditor即提交后,接收数据页面 $_POST['myFCKeditor']使用
        $FCKeditor=new FCKeditor('myFCKeditor');
        //FCKeditor所在的位置,这里它的位置就是'FCKeditor' 文件夹
        $FCKeditor->BasePath='./FCKeditor/';
        //工具按钮设置
        $FCkeditor->ToolbarSet='Default';
        //设置它的宽度
        $FCKeditor->Width='100%';
        //设置它的高度
        $FCKeditor->Height='300px';
        //生成
        $FCkeditor->Create();
      
?>
      
</Form>

<br>
<input type="submit" value="提交">
</form>
</body>
</html>


fckediter demo 下载

抱歉!评论已关闭.