How to add fckeditor to a dynamically creating form in php??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hmdnawaz
Forum Newbie
Posts: 14
Joined: Tue Dec 21, 2010 10:55 pm

How to add fckeditor to a dynamically creating form in php??

Post by hmdnawaz »

I am creating a dynamic form in php. And i want to add fckeditor to this dynamic form.
so any idea about to add fckeditor to a dynamically creating form in php???

Any Help please???
User avatar
amirbwb
Forum Commoner
Posts: 89
Joined: Sat Oct 30, 2010 6:10 pm

Re: How to add fckeditor to a dynamically creating form in p

Post by amirbwb »

hi so this is easy ...
copy the fckeditor directory to your server...
lets say you want it to be in www.example.com/amirbwb/fckeditor/
in the file www.example.com/amirbwb/[b]index.php[/b]
write this in the top:

Code: Select all

<?php require_once('fckeditor/fckeditor.php'); ?> //check if the file exist first, maybe you have moved the file
and then replace the textarea by this:

Code: Select all

<?php            
          $oFCKeditor = new FCKeditor('FCKeditor1');
		  $oFCKeditor -> BasePath = 'fckeditor/';
		  $oFCKeditor -> Value = '';
		  $oFCKeditor -> Create();
		  
		  ?>
and when you want to insert the value in the database :

Code: Select all

$content = stripslashes($_POST['FCKeditor1']);
insert into .... values($content)...
good luck
hmdnawaz
Forum Newbie
Posts: 14
Joined: Tue Dec 21, 2010 10:55 pm

Re: How to add fckeditor to a dynamically creating form in p

Post by hmdnawaz »

My database insertion is doing on another page.
So where can i write the following code?

$content = stripslashes($_POST['FCKeditor1']);
User avatar
amirbwb
Forum Commoner
Posts: 89
Joined: Sat Oct 30, 2010 6:10 pm

Re: How to add fckeditor to a dynamically creating form in p

Post by amirbwb »

write this in the file where the ...insert into database..." exist make sure you put it just before it =D
good luck
hmdnawaz
Forum Newbie
Posts: 14
Joined: Tue Dec 21, 2010 10:55 pm

Re: How to add fckeditor to a dynamically creating form in p

Post by hmdnawaz »

I wrote that code before the insert query but it only stores the data when we statically assign text to fckeditor using its value property and the text we enter after execution of the page does not store.

What is the problem?
User avatar
amirbwb
Forum Commoner
Posts: 89
Joined: Sat Oct 30, 2010 6:10 pm

Re: How to add fckeditor to a dynamically creating form in p

Post by amirbwb »

i don't know your code can u post it so i can see whats wrong ;) ...
Post Reply