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 strtok()函数的优点分析

其优点是: 1、可以一次定义多个分隔符。函数在执行时,是按单个分隔符来切割,而不是按整个分隔符,而explode则是按整个分隔串来切割的。正因此,explode可以用中文切割,而str...

php 实现svg转化png格式的方法分析

php 实现svg转化png格式的方法分析

本文实例讲述了php 实现svg转化png格式的方法。分享给大家供大家参考,具体如下: svg转png实现 1.php imagick扩展插件 a.研究imagick插件方法 $im...

php rmdir使用递归函数删除非空目录实例详解

 首先向大家介绍一下rmdir()函数。 php rmdir()函数 rmdir — 删除空目录 语法: bool rmdir ( string $dirname [, res...

PHP中加密解密函数与DES加密解密实例

本文实例讲述了PHP中加密解密函数与DES加密解密的应用,分享给大家供大家参考。具体如下: 例子,php加密解密的例子 加密函数: 复制代码 代码如下:/* *功能:对字符串进行加密处理...

php 获取当前访问的url文件名的方法小结

推荐函数: 一是PHP获取当前页面的网址: dedecms也是用的这个 //获得当前的脚本网址 function GetCurUrl() { if(!empty($_SER...