php calls the methods of the fckeditor editor on the page
- 2020-05-09 18:13:35
- OfStack
I just saw a child's shoes on the forum to share the method, the feeling is not very comprehensive, now share my!
PHP Page:
/* The editor */
include_once "../include/fckeditor/fckeditor.php";// Bring in 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";// Toolbar name, can be loaded according to their own needs
$editor->Width = "95%";// The width of the degree of
$editor->Height = "250";// highly
$editor->Value = $content;// The initial value
$fckeditor = $editor->CreateHtml();// Output variables where you want to display the editor $fckeditor The value of
$tpl->assign('fckeditor', $fckeditor);// Template for the assignment
HTML The template page ( I am using smarty)
{%$fckeditor%}
1 a php Page calls
content Is the variable name that I defined
$content =$_POST["content"];
Add:
<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>
Modification page:
<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>