FckEditor's articles have been introduced before. Today, let's talk about how to use PHP to call the FCK editor. The Code of fckeditor can be written as a function or category and called directly, you don't have to write so much code every time! I just saw a way to share my shoes on the forum. I don't feel very comprehensive. Now I want to share it with you!
Copy to ClipboardReference content: [www.bkjia.com] PHP page:
/* Editor */
Include_once "../include/fckeditor. php"; // introduce the editor
$ Editor = new FCKeditor ('content'); // name of the form item
$ Editor-> BasePath = "/fckeditor/"; // directory of the editor
$ Editor-> ToolbarSet = "Normal"; // name of the toolbar. you can load other
$ Editor-> Width = "95%"; // Width
$ Editor-> Height = "250"; // Height
$ Editor-> Value = $ content; // Initial Value
$ Fckeditor = $ editor-> CreateHtml (); // You can output the value of the variable $ fckeditor where you want to display the editor.
$ Tpl-> assign ('fckeditor', $ fckeditor); // template assignment
HTML template page (I use smarty)
{% $ Fckeditor %}
Php page call
Content is the variable name 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>
Modify 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>