Home > Article > Backend Development > How to call fckeditor editor in php page
I just saw a method for sharing children’s shoes on the forum. I don’t think it is very comprehensive. Now I will share mine!
Copy the code The code is as follows:
PHP page:
/* Editor*/
include_once "../include/fckeditor/fckeditor.php";//Introduce the editor
$editor = new FCKeditor('content') ;//The name of the form item
$editor->BasePath = "/fckeditor/";//The directory where the editor is located
$editor->ToolbarSet = "Normal";//The name of the toolbar can be based on your own Need to load other
$editor->Width = "95%";//Width
$editor->Height = "250";//Height
$editor->Value = $content;//Initial Value
$fckeditor = $editor->CreateHtml();//Just output the value of variable $fckeditor where you want to display the editor
$tpl->assign('fckeditor', $fckeditor);// Template assignment
HTML template page (I use smarty)
{%$fckeditor%}
General php page call
content is the variable name I defined
$content =$_POST["content"];
Add:
Modify the page: