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

yipeiwu_com5年前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>

相关文章

让你的网站首页自动选择语言转跳

大家都在用google,你用中文系统打开google的首页,打开的自然是中文首页,而不会是其他语言。因为google会自动判断用户系统使用的首选语言是什么。  怎样才能做到像g...

PHP中使用asort进行中文排序失效的问题处理

PHP中有非常方便的对数组进行重新排序的方法——asort,关于asort的使用方法可以看 这里 。但是asort对含有中文key的数组进行排序时,有时候并不是按照字母顺序。这主要是编码...

PHP字符串 ==比较运算符的副作用

复制代码 代码如下: $a = '212345678912000005'; $b = '212345678912000001'; var_dump($a == $b); 这段代码的输出...

PHP实现的CURL非阻塞调用类

本文实例讲述了PHP实现的CURL非阻塞调用类。分享给大家供大家参考,具体如下: 前面一篇《PHP实现非阻塞模式的方法》文章讲述了PHP中实现非阻塞模式,其实如果只是HTTP的话,直接用...

php运行提示:Fatal error Allowed memory size内存不足的解决方法

本文实例讲述了php运行提示:Fatal error Allowed memory size内存不足的解决方法。分享给大家供大家参考。具体方法如下: 有些朋友新配置的环境或自己新写的程序...