Php calls ckeditor? How to call ckeditor

Source: Internet
Author: User

How can we call ckeditor? The following small series will summarize the methods for calling ckeditor by using php and calling ckeditor by js. The methods for calling other scripts are roughly the same.

PHP calls FCKeditor

Put FCKeditor in the website root directory
The PHP file contains the/FCKeditor/ckeditor/"target =" _ blank "> fckeditor. php file.

Insert the following code where the editor needs to be placed on the webpage to call it:

The Code is as follows: Copy code
<? Php
// Contains the fckeditor class
Include ("fckeditor/fckeditor. php ");
// Create a FCKeditor with the form name jzleditor
$ OFCKeditor = new FCKeditor ("jzleditor ");
// Set the editor path
$ OFCKeditor-> BasePath = "fckeditor /";
$ OFCKeditor-> ToolbarSet = "Default"; // tool button
$ OFCKeditor-> Value = $ cont; //; set the initial content
$ OFCKeditor-> Width = "100%"; // set its Width.
$ OFCKeditor-> Height = "550px"; // set its Height
$ OFCKeditor-> Create ();
?>

Input content. After submission, the input content is obtained through $ _ POST ["jzleditor"] in the processed file.

Js calls FCKeditor

CKEDITOR is easy to use. First download CKEDITOR 3.6.1 (PHP version by default), and then write the following two sections of js in the head of the call page:

The Code is as follows: Copy code

<Script type = "text/javascript" src = "ckeditor/ckeditor. js"> </script>
<Script type = "text/javascript"> window. onload = function ()
{
CKEDITOR. replace ("content ");
};

</Script>

Note: The content here is the name of <textarea>, as shown below:

<Textarea name = "content"> ddd </textarea> for version 3.6.2, this statement may be written as follows:

<Textarea name = "content" class = "ckeditor"> ddd </textarea>

For issues caused by version differences, please pay attention to this issue during runtime.

On the next page, obtain the corresponding value based on the name value content

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.