php下配置使用FCKeditor控件

关于下载在上一篇文章中已经提到过了,在这里就不再次说明了。

 

1)复制文件

FCKeditor解压到自己的php网站目录下。存放位置随意,这里我默认是在根目录下

 

2)调用fckeditor.php类文件

<?php

include("fckeditor/fckeditor.php") ; // 用于载入FCKeditor类文件

?>

 

 

 

3)实例化控件,你可以把它放在表单中你想要显示的位置中,方便取值

<?php $oFCKeditor = new FCKeditor('FCKeditor1') ; // 创建FCKeditor实例 $oFCKeditor->BasePath = './fckeditor/'; // 设置FCKeditor目录地址 $FCKeditor->Width='100%'; //设置显示宽度 $FCKeditor->Height='300px'; //设置显示高度的高度 $oFCKeditor->Create() ; // 创建编辑器 ?>

4)取值:直接通过$_request[]获得该控件的值

5)这时候你可能发现文件和图片的上传浏览功能无法实现。你需要进行一下配置

一、打开fckeditor/editor/filemanager/upload/php/config.php,找到代码$Config['Enabled'],将值设置为true
二、接下来几行,设置$Config['UserFilesPath'],设置上传路径。
三、打开fckeditor/fckconfig.js文件,找到代码_FileBrowserLanguage,将值设置为php。接下来一行,把_QuickUploadLanguage值也设置为php

你可能感兴趣的:(PHP,fckeditor)