php在页面中挪用fckeditor编辑器的代码
发布时间:2018-10-10 02:12:58 所属栏目:创业 来源:站长网
导读:关于FckEditor的文章,猛火学院早年先容了一些,本日再来说一下怎样行使PHP挪用FCK编辑器,fckeditor编辑器的代码可以写成一个函数可能种别,直接挪用,不消每次都要写那么多代码!适才在论坛上看到一个童鞋分享的要领,感受不是很全面,此刻分享下我的! C
关于FckEditor的文章,猛火学院早年先容了一些,本日再来说一下怎样行使PHP挪用FCK编辑器,fckeditor编辑器的代码可以写成一个函数可能种别,直接挪用,不消每次都要写那么多代码!适才在论坛上看到一个童鞋分享的要领,感受不是很全面,此刻分享下我的! Copy to Clipboard引用的内容:[www.veryhuo.com] 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> (编辑:河北网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
站长推荐
热点阅读