Home  >  Article  >  Backend Development  >  How to call fckeditor editor in php page

How to call fckeditor editor in php page

高洛峰
高洛峰Original
2016-11-30 10:24:431038browse

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:

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn