復制代碼 代碼如下:
 
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 type=hidden> 
<IFRAME src="fckeditor/editor/fckeditor.html?InstanceName=content&Toolbar=Normal" frameBorder=0 width=100% scrolling=no height=300 ></IFRAME> 
修改頁面: 
<INPUT type=hidden value="<?php echo $rows['content'];?>"> 
<IFRAME src="/fckeditor/editor/fckeditor.html?InstanceName=content&Toolbar=Normal" frameBorder=0 width=100% scrolling=no height=300 > 
</IFRAME> 
新聞熱點
疑難解答