首页 php教程 php手册 php调用ckeditor?怎么调用ckeditor

php调用ckeditor?怎么调用ckeditor

Jun 02, 2016 am 09:14 AM
ckeditor include textarea

怎么调用ckeditor呢,下面小编来给大家总结一处利用php 调用ckeditor编辑器与js调用ckeditor的方法吧,其它脚本调用方法大致一样了。

PHP调用FCKeditor 

将FCKeditor放在网站根目录

在PHP文件里面,包含/FCKeditor/fckeditor.php文件

在网页中需要放置该编辑器的地方插入下面代码即可调用:

<?php
//包含fckeditor类
include("fckeditor/fckeditor.php") ;
//创建一个FCKeditor,表单名称为 jzleditor
$oFCKeditor = new FCKeditor("jzleditor");
//设置编辑器路径
$oFCKeditor->BasePath = "fckeditor/";
$oFCKeditor->ToolbarSet = "Default";//工具按钮
$oFCKeditor->Value =$cont; //;设置初始内容
$oFCKeditor->Width="100%"; //设置它的宽度
$oFCKeditor->Height="550px"; //设置它的高度
$oFCKeditor->Create();
?>
登录后复制

输入内容,提交后,在处理的文件中通过$_POST["jzleditor"]来取得输入的内容

js调用FCKeditor

CKEDITOR的使用很简单,先download CKEDITOR 3.6.1(默认是PHP版的),然后在调用页面的head中,写下如下两段js:

<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script type="text/javascript">                                                                    window.onload = function()
{
  CKEDITOR.replace( "content" );
};
</script>
登录后复制

注意:这里的content是

如果是3.6.2版本,该语句可能要写成:

版本差异造成的问题,请大家在运行时注意这个问题。

在下一个页面根据name值content获取相应的值


教程网址:

欢迎收藏∩_∩但请保留本文链接。

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
2 周前 By 尊渡假赌尊渡假赌尊渡假赌
仓库:如何复兴队友
4 周前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
3 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)