php在页面中调用fckeditor编辑器的方法

yipeiwu_com6年前PHP代码库
刚才在论坛上看到一个童鞋分享的方法,感觉不是很全面,现在分享下我的!
复制代码 代码如下:

PHP页面:
/* 编辑器 */
include_once "../include/fckeditor/fckeditor.php";//把编辑器引进来
$editor = new FCKeditor('content');//表单项的名称
$editor->BasePath = "/fckeditor/";//编辑器所在目录
$editor->ToolbarSet = "Normal";//工具栏的名字,可以根据自己的需求加载其他的
$editor->Width = "95%";//宽度度
$editor->Height = "250";//高度
$editor->Value = $content;//初始值
$fckeditor = $editor->CreateHtml();//在要显示编缉器的地方输出变量$fckeditor的值就行了
$tpl->assign('fckeditor', $fckeditor);//模板赋值

HTML模板页面(我用的是smarty)
{%$fckeditor%}

一般php页面调用
content 是我定义的变量名
$content =$_POST["content"];
添加:
<INPUT name="content" id="content" type=hidden>
<IFRAME id="content" src="fckeditor/editor/fckeditor.html?InstanceName=content&Toolbar=Normal" frameBorder=0 width=100% scrolling=no height=300 ></IFRAME>
修改页面:
<INPUT name="content" id="content" type=hidden value="<?php echo $rows['content'];?>">
<IFRAME id="content" src="/fckeditor/editor/fckeditor.html?InstanceName=content&Toolbar=Normal" frameBorder=0 width=100% scrolling=no height=300 >
</IFRAME>

相关文章

php开发工具有哪五款

php开发工具有哪五款

 由于最近小编要自学php,所以整理了一些常用的php开发工具,给大家分享一下: 1、EditPlus     EditPlus是一套功能强大,...

PHP实现十进制数字与二十六进制字母串相互转换操作示例

本文实例讲述了PHP实现十进制数字与二十六进制字母串相互转换操作。分享给大家供大家参考,具体如下: <?php /** * 将十进制数字转换为二十六进制字母串 */...

phpwind中的数据库操作类

<?php /*来源:phpwind.net*/ Class DB { var $query_num = 0; function&...

网站用php实现paypal整合方法

所以今天我就来讲讲如何将你的网站和paypal进行整合。 首先,去paypal申请一个号吧,资料都补充完整之后,我们就可以开始行动乐,对了,申请paypal时,要申请那种可以接受别人付款...

php文件操作小结(删除指定文件/获取文件夹下的文件名/读取文件夹下图片名)

本文实例分析了php文件操作的方法。分享给大家供大家参考,具体如下: 一、删除文件 unlink() 语法: int unlink(string filename); 返回值: 整数 函...