復制代碼 代碼如下:
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>
php技術:php在頁面中調用fckeditor編輯器的方法,轉載需保留來源!
鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。