网站编辑内容始终离不开编辑器,使用一个不错的编辑器对于网站编辑来说是很重要的。当然写程序的不管这个,好用不好用反正不是我用。哈哈,也不能这么虐待编辑,php编辑器用的比较多,比较好的编辑器是 fckeditor。这个编辑器功能比较多,基本上的编辑工作都能应付。那么今天给大家介绍一下怎么调用fckeditor

首先看一下调用文件fckeditor.php

<?php
/*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
* Licensed under the terms of any of the following licenses at your
* choice:
*
*  - GNU General Public License Version 2 or later (the "GPL")
*    http://www.gnu.org/licenses/gpl.html
*
*  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
*    http://www.gnu.org/licenses/lgpl.html
*
*  - Mozilla Public License Version 1.1 or later (the "MPL")
*    http://www.mozilla.org/MPL/MPL-1.1.html
*
* == END LICENSE ==
*
* Sample page.
*/

include("./fckeditor/fckeditor.php") ;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>FCKeditor - Sample</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<link href="../sample.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>PHP版fck编辑器</h1>
<form action="submit.php" method="post" target="_blank">
<?php
$oFCKeditor = new FCKeditor('FCKeditor1') ;
$oFCKeditor->BasePath    = './fckeditor/';
$oFCKeditor->Width ='500';
$oFCKeditor->Height ='500';
$oFCKeditor->Value        = '这是fck编辑器' ;
$oFCKeditor->Create() ;
?>
<br>
<input type="submit" value="Submit">
</form>
</body>
</html>

这里引入了fckeditor的包调用出编辑器界面,包文件就直接放到fckeditor.php同级目录。有的时候编辑器的config.php配置不好也会出现调用界面有错误的问题。在这里我就直接把编辑器所有包放在这里,愿意研究的直接下载下来吧。

fckeditor

 

 

 

本文地址 :http://www.songlin51.com/archives/717.html

文章均属 松林's blog 原创 转载请注明转自 松林's blog