Web Content Management System (Web CMS) is the best way to maximize your efforts. An effective Web CMS system will enable you to update the content in your site simply using admin panel. This means you have full control of your site and updating site can be completed in minutes.
What is FCKEditor?
FCKEditor is a web-based WYSIWYG (What You See Is What You GET) HTML text editor which enable you to edit your website content as much as like using Microsoft Word. Its easy to use and doesn’t need installation on client computer.
FCKEditor is distributed under GPL (General Public License), LGPL (Lesser General Public License), and MPL (Mozilla Public License) source licenses and currently supported ASP.NET, Active-FoxPro, ASP, Lasso, ColdFusion, Perl, PHP, Phyton and Java. FCKEditor is Multi Browser Compatibility, support file uploads and outputs XHTML 1.0. This editor is also customizable, easy to configure, integrated spell checker, and the most important is CSS Support so you can see the real preview of your site before the content is published.
I myself have used FCKEditor for a long time for my client projects in both PHP and ASP version. For me, FCKEditor is easy to use than TinyMCE, openWYSIWYG, TextArea Rich and the other WYSIWYG editor.
Where can I download FCKEditor?
You can download FCKEditor by go to FCKEditor official site: http://www.fckeditor.net . The current latest released is 2.6.3
How can I integrate FCKEditor with PHP?
FCKEditor is simply a replacement for text box or textarea input. Here is the simple steps:
1. Extract the downloaded zip file (from http://www.fckeditor.net) to your web directory.
2. In your php file, include the fckeditor.php file:
include(”fckeditor/fckeditor.php”) ;
Note: In this case, fckeditor folder is located at the same directory as my current php file.
3. Put the code below between <form> tag or just replace the text box or textarea control:
$ctrl_name = 'product_long_desc';
$sBasePath = 'fckeditor/';
$oFCKeditor = new FCKeditor($ctrl_name) ;
$oFCKeditor->Height = "300px";
$oFCKeditor->Width = "730px";
$oFCKeditor->BasePath = $sBasePath ;
$oFCKeditor->Value = "" ;
$oFCKeditor->Create() ;
$ctrl_name - Control name
$sBasePath - The location of your fckeditor folder with trailing slash
$oFCKeditor - FCKEditor class instance
$oFCKeditor->Height - define the height of the editor
$oFCKeditor->Width - define the width of the editor
$oFCKeditor->BasePath - fckeditor folder location
$oFCKeditor->Value - Initial value for the control. You can also use PHP variable (for sticky form)
$oFCKeditor->Create() - create and display the editor
4. For the file/image uploader function to work, you need to create the upload folder and configure the PHP connector file.
a. Create the upload folder
To create the upload folder, simply create a new folder named fckdata (optionally you can named it whatever you want) in your web directory and give the write permission (chmod 777) to the folder.
b. Configure the connector file.
The connector file (config.php) is located at:
fckeditor\editor\filemanager\connectors\php\config.php
Open config.php file and set the configuration below:
$Config['Enabled'] = true ;
$Config['UserFilesPath'] = ‘http://www.technologytricks.com/fckdata/’;
$Config['UserFilesAbsolutePath'] = ‘/home/tech/public_html/fckdata/’;
$Config['UserFilesPath'] - absolute url for your upload folder
$Config['UserFilesAbsolutePath'] - absolute directory location to the upload folder.
5. You have successfully integrated FCKEditor in your PHP application.
Result:
Please post a comment if you have problem with the installation.
To receive updates on new articles, subscribe to Technology Tricks today.



















19 Comments Received
November 14th, 2008 @ 1:21 AM
Dear
I have follow up the exact settings but still i am unable to create folder on server.
Regards
Ejaz Khan
December 29th, 2008 @ 6:31 PM
Very very useful post.
Really nice tip for integrating the editor..
Thanks a lot
February 17th, 2009 @ 3:50 AM
dear
i would like to develop a small website in asp and occassionaly i like to change the content of one page called “programes.asp”.
how can i develop this page by content managemnt site , i hope fck editor is good but i dont know how to configure fckeditor in asp page,
if dont mind give me a detailed explanation and steps
thanks in advance
regards
reji
April 15th, 2009 @ 2:19 PM
Cool post, I am definitely using this.
thanks a lot
May 27th, 2009 @ 9:30 PM
If you your Apache with MS Windows then absolute directory location to the upload folder should be like this:
$Config['UserFilesAbsolutePath'] = ‘C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/fckdata/’;
May 28th, 2009 @ 6:12 PM
Do I have to upload the whole fckeditor folder?
Thanks
May 28th, 2009 @ 9:05 PM
It is safe to upload the entire folder.
June 1st, 2009 @ 3:22 PM
In the above example, what will be the name of the editor? Name that your going to use in your PHP code. Is it $oFCKeditor or $control_name or you are the one who will create that? Thanks.
June 1st, 2009 @ 3:40 PM
$oFCKeditor is just variable… you can name it whatever you want.
June 1st, 2009 @ 5:34 PM
Can I know how can I name it? Thanks
June 2nd, 2009 @ 11:40 AM
Hi..
Code:
$oFCKeditor = new fckeditor(’fcktext’);
$oFCKeditor->BasePath = “fckeditor/”;
$oFCKeditor->Value = “”;
$oFCKeditor->Width = “550px”;
$oFCKeditor->Height = “350px”;
echo $oFCKeditor->CreateHtml();
In the above code, what is the name of the fckeditor? Is it (’fcktext)? Thank you.
June 2nd, 2009 @ 12:09 PM
$oFCKeditor is the instance of fckeditor object.
fcktext is the form field name…. which you use to get the value from php… after the form is submitted, you can get what user entered in that field by $_POST['fcktext'] (for post) or $_GET['fcktext'] (for get)
June 2nd, 2009 @ 2:45 PM
Thanks a lot. That is probably the solution to my problem. But apparently, I have another problem. When I submit the form I have a javascript code to trap if the fcktext field and other field are null. If it is null an alert window will pop up. The alert window is present but the problem is, all the other field that has data, becomes null. But of course I didn’t put a code for them to become null. Thanks and sorry if I have so many questions..
June 16th, 2009 @ 11:38 AM
very nice tutorials
July 8th, 2009 @ 3:36 PM
I run php-nuke platnum, the fckeditor came with it but is erroring out, do you know of what version I could replace it with to try and fix this issue. Is for a business site I manage so is a big issue.
July 9th, 2009 @ 4:48 AM
This is a great post. Thank you.
September 11th, 2009 @ 5:35 AM
Hi! I was surfing and found your blog post… nice! I love your blog.
Cheers! Sandra. R.
January 18th, 2010 @ 4:45 AM
I didn’t know there was a web-based WYSIWYG editor like this. Best part is that it’s free.
January 18th, 2010 @ 7:01 PM
Hello ,
We want to remove font size and font face then how can we remove this option.Please help me.
Leave A Reply