Page 1 of 1

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

Posted: Mon Jan 03, 2011 4:38 am
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???

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

Posted: Mon Jan 03, 2011 9:40 am
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

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

Posted: Mon Jan 03, 2011 11:41 pm
by hmdnawaz
My database insertion is doing on another page.
So where can i write the following code?

$content = stripslashes($_POST['FCKeditor1']);

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

Posted: Tue Jan 04, 2011 10:35 am
by amirbwb
write this in the file where the ...insert into database..." exist make sure you put it just before it =D
good luck

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

Posted: Tue Jan 04, 2011 10:54 pm
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?

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

Posted: Wed Jan 05, 2011 8:56 am
by amirbwb
i don't know your code can u post it so i can see whats wrong ;) ...