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

高洛峰
发布: 2016-11-30 10:24:43
原创
1347人浏览过

刚才在论坛上看到一个童鞋分享的方法,感觉不是很全面,现在分享下我的! 
复制代码 代码如下: 
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怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号