Use fckeditor in php

Source: Internet
Author: User
Tags php file upload
Php uses fckeditor 1: modify the file upload language to PHP
Open fckconfig. js
Find:
Var _ FileBrowserLanguage = 'asp'
Var _ QuickUploadLanguage = 'asp'
Changed:
Var _ FileBrowserLanguage = 'php'
Var _ QuickUploadLanguage = 'php'

II. enable PHP file Upload

1: enable FileBrowser:
Open fckeditor/editor/filemanager/browser/default/connectors/php/config. php
Enable file upload:

Find:
$ Config ['enabled'] = false

Changed:
$ Config ['enabled'] = true

Set the upload Directory:

Find:
$ Config ['userfilespath'] = '/userfiles /'
Changed:
$ Config ['userfilespath'] = 'your project path'

2: enable QuickUpload
Open fckeditor/editor/filemanager/upload/php/config. php
Enable file upload:

Find:
$ Config ['enabled'] = false
Changed:
$ Config ['enabled'] = true

Set the upload Directory:

Find:
$ Config ['userfilespath'] = '/userfiles /'
Changed:
$ Config ['userfilespath'] = 'your project path'



Use instance

$ Fck = $ _ POST ["FCKeditor1"];
If ($ fck! = "")
{
Echo htmlspecialchars ($ fck); // htmlspecialchars () is used to convert special characters in text information into html string formats. The most common scenario is to process the message board of customer messages.
}
?>



Fck test






JS uses alert (FCKeditorAPI. GetInstance ('fckeditor1'). GetXHTML (true) to get the value of FCKeditor1;
PHP uses $ _ POST ['fckeditor1'] to get the value of fckeditor1.

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.