手机
当前位置:查字典教程网 >编程开发 >php教程 >php在页面中调用fckeditor编辑器的方法
php在页面中调用fckeditor编辑器的方法
摘要:刚才在论坛上看到一个童鞋分享的方法,感觉不是很全面,现在分享下我的!复制代码代码如下:PHP页面:/*编辑器*/include_once"....

刚才在论坛上看到一个童鞋分享的方法,感觉不是很全面,现在分享下我的!

复制代码 代码如下:

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="http://www.jb51.netfckeditor/editor/fckeditor.html?InstanceName=content&Toolbar=Normal" frameBorder=0 width=100% scrolling=no height=300 >

</IFRAME>

【php在页面中调用fckeditor编辑器的方法】相关文章:

php实现在服务器端调整图片大小的方法

PHP调用三种数据库的方法(3)

php常见的页面跳转方法汇总

php获取twitter最新消息的方法

php使用curl打开https网站的方法

php函数重载的替代方法

php动态函数调用方法

php输出全球各个时区列表的方法

php 类自动载入的方法

php中smarty实现多模版网站的方法

精品推荐
分类导航