Home >Backend Development >PHP Tutorial >How to use fckeditor editor PHP_PHP tutorial

How to use fckeditor editor PHP_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:51:151080browse

FCK configuration in php
1: Change the file upload language to PHP
Open fckconfig.js
Found:
var _FileBrowserLanguage = 'asp'
var _QuickUploadLanguage = 'asp'
Change to:
var _FileBrowserLanguage = 'php'
var _QuickUploadLanguage = 'php'

Two: Enable PHP file upload
1: Enable FileBrowser:
Open fckeditor/editor/filemanager/connectors/php/config.php
Enable file upload:
Found:
          $Config['Enabled'] = false

Change to:
          $Config['Enabled'] = true

Set upload storage directory:
Found:
         $Config['UserFilesPath'] = '/userfiles/'
                                                                Changed to:
         $Config['UserFilesPath'] = 'Your own project path'

2: Enable QuickUpload
Open fckeditor/editor/filemanager/upload/php/config.php
Enable file upload:
Found:
          $Config['Enabled'] = false
                                                                Changed to:
          $Config['Enabled'] = true

Set the upload storage directory:
Found:
         $Config['UserFilesPath'] = '/userfiles/'
                                                                Changed to:
         $Config['UserFilesPath'] = 'Your own project path'

Usage examples
$fck = $_POST [ " FCKeditor1 " ] ;
if ( $fck != "" )
{
echo htmlspecialchars ( $fck ) ;
}
?>


fck test



include ( " fckeditor/fckeditor.php " ); //Load file
$oFCKeditor = new FCKeditor ( ' FCKeditor1 ' ); //Create a FCKeditor object with the ID FCKeditor1
$oFCKeditor -> BasePath = " /fck/fckeditor/ " ; //Set FCKeditor path
$oFCKeditor -> Value = '' ; //Set default value
$oFCKeditor -> Create () ; //Create. Note: If a template (such as smarty) is used, $fck = $oFCKeditor->CreateHtml(); and then throw $fck to the template
?>




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

Excerpted from Web0730

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478224.htmlTechArticleFCK configuration in php 1: Modify the file upload language to PHP. Open fckconfig.js and find: var _FileBrowserLanguage = asp var _QuickUploadLanguage = asp changed to: var _FileBrowserLanguage =...
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