php調用ckeditor?怎麼調用ckeditor_PHP教程

來源:互聯網
上載者:User
怎麼調用ckeditor呢,下面小編來給大家總結一處利用php 調用ckeditor編輯器與js調用ckeditor的方法吧,其它指令碼調用方法大致一樣了。

PHP調用FCKeditor

將FCKeditor放在網站根目錄
在PHP檔案裡面,包含/FCKeditor/ckeditor/" target="_blank">fckeditor.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:

代碼如下 複製代碼


注意:這裡的content是的名稱,如下所示:</p><p><textarea name="content">ddd如果是3.6.2版本,該語句可能要寫成:

ddd

版本差異造成的問題,請大家在運行時注意這個問題。

在下一個頁面根據name值content擷取相應的值

http://www.bkjia.com/PHPjc/633142.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/633142.htmlTechArticle怎麼調用ckeditor呢,下面小編來給大家總結一處利用php 調用ckeditor編輯器與js調用ckeditor的方法吧,其它指令碼調用方法大致一樣了。 PHP調用...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.