本文目錄一覽:
- 1、php 中的FCKeditor,我想在FCKeditor文件夾外面調用fckeditor,怎麼配置?
- 2、FCKeditor在php是怎麼用的啊
- 3、PHP 使用fckeditor
- 4、PHP怎樣使用FCKeditor ?
php 中的FCKeditor,我想在FCKeditor文件夾外面調用fckeditor,怎麼配置?
先要在你想調用編輯器的文件中引用:include “fckeditor/fckeditor.php”;
然後在你想放編輯器的地方寫上:
?php
$oFCKeditor = new FCKeditor(‘content’) ;
$oFCKeditor-BasePath = ‘fckeditor/’ ;
$oFCKeditor-ToolbarSet = ‘Default’ ;
$oFCKeditor-InstanceName = ‘content’ ;
$oFCKeditor-Width = ‘100%’ ;
$oFCKeditor-Height = ‘400’ ;
$oFCKeditor-Value = ”;
$oFCKeditor-Create() ;
?
FCKeditor在php是怎麼用的啊
function CreateEditor ($act,$id,$url) { #調用FCKeditor並補完發表文章的表單,act=0:發表新文章 =1修改文章
include(“editor/fckeditor.php”); //FCKeditor已存放到此目錄下
$oEditor = new FCKeditor (“content”); //對應於一個input控制項,相當於是一個name=content的textarea
$oEditor – BasePath = ‘editor/’; //配置基本信息
$oEditor – Width = “100%”;
$oEditor – Height = “400”;
if( $act ) {
$query = “SELECT title,content FROM article WHERE id=$id”;
$result = mysql_query($query);
$fillin = mysql_fetch_array($result);
}
echo ‘form action=”‘.$url.'” method=”post”‘;
echo ‘pTitle: input type=”text” class=”text” class=”text” name=”title” size=”100″ value=”‘.$fillin[‘title’].'”/pp’;
if( $act ) $oEditor – Value = $fillin[‘content’]; //若是修改文章,則將原文章內容放進編輯器
$oEditor – Create(); //創建編輯器
echo ‘/p’;
echo ‘pinput type=”submit” class=”button” value=”P o s t”/p’;
echo ‘/form’;
}
PHP 使用fckeditor
script src=”../../fckeditor2/fckeditor.js”/script
script type=”text/javascript”
var oFCKeditor = new FCKeditor( ‘detail’ ) ;
oFCKeditor.BasePath = ‘../../fckeditor2/’ ;
oFCKeditor.ToolbarSet = ‘Default’ ;
oFCKeditor.Width = ‘100%’ ;
oFCKeditor.Height = ‘250px’ ;
oFCKeditor.Value = ‘{–$arr.detail–}’ ;
oFCKeditor.Create() ;
/script
{–$arr.detail–} 是你讀取的欄位已默認顯示,自己修改
PHP怎樣使用FCKeditor ?
這個也好簡單的,調用FCK有固定的格式,那裡面也有配置,不難的
原創文章,作者:ASJH,如若轉載,請註明出處:https://www.506064.com/zh-tw/n/132222.html