Hello, I want to add CKEditor 3.x in my PHP website and I'm having some problem which I hope you knowledge in php will help me to fix it - I successfuly add the editor in my site with this dode: <?PHP echo "<form method='post' action='1.php'>"; include "ckeditor/ckeditor.php"; $CKEditor = new CKEditor(); $CKEditor->editor("editor1", "<p>Initial value.</p>"); echo "<input type='submit'>"; echo "</form>"; ?> PHP: now I want to modify the size and add path to images folder (so users will be able to upload them). for that I add this code: <?PHP echo "<form method='post' action='1.php'>"; include "ckeditor/ckeditor.php"; $CKEditor = new CKEditor(); $CKEditor->editor("editor1", "<p>Initial value.</p>"); $CKEditor->CKEDITOR.replace( 'editor1', { filebrowserBrowseUrl : '/browser/browse.php', filebrowserUploadUrl : '/uploader/upload.php', filebrowserWindowWidth : '640', filebrowserWindowHeight : '480' }); echo "<input type='submit'>"; echo "</form>"; ?> PHP: and as you probably guess - it didn't work ("Parse error: parse error in C:\Program Files\wamp\www\editor\1.php on line 9"). why? I did it like in this example: http://docs.cksource.com/CKEditor_3.x/Developers_Guide/File_Browser_(Uploader) and also - where do I define the path/folder for images to be store/uploaded? Thank you all in advanced!
Try this: <?PHP echo "<form method='post' action='1.php'>"; include "ckeditor/ckeditor.php"; $CKEditor = new CKEditor(); $CKEditor->editor("editor1", "<p>Initial value.</p>"); { $CKEditor->CKEDITOR.replace('editor1'); filebrowserBrowseUrl : '/browser/browse.php'; filebrowserUploadUrl : '/uploader/upload.php'; filebrowserWindowWidth : '640'; filebrowserWindowHeight : '480'; } echo "<input type='submit'>"; echo "</form>"; ?> PHP: tell me what happens,
Hi, thanks for your reply - I see the editor and below it the error: Notice: Undefined property: CKEditor::$CKEDITOR in C:\Program Files\wamp\www\editor\1.php on line 8 Fatal error: Call to undefined function replace() in C:\Program Files\wamp\www\editor\1.php on line 8
could you try to enforce the script with a defined DOCTYPE eg: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Code (markup): seems to be a similar issue here too, As I can't see the full code I can only assume, I'd try the cksource forum support as well.
I published poast there too, but here we have more forum activitly. I add your code at the top of my source (the one you wrote before) and I still have the error.... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> </head> <body> <?PHP echo "<form method='post' action='1.php'>"; include "ckeditor/ckeditor.php"; $CKEditor = new CKEditor(); $CKEditor->editor("editor1", "<p>Initial value.</p>"); { $CKEditor->CKEDITOR.replace('editor1'); filebrowserBrowseUrl : '/browser/browse.php'; filebrowserUploadUrl : '/uploader/upload.php'; filebrowserWindowWidth : '640'; filebrowserWindowHeight : '480'; } echo "<input type='submit'>"; echo "</form>"; ?> <body> </html> PHP:
<?PHP error_reporting(0); echo "<form method='post' action='1.php'>"; include "ckeditor/ckeditor.php"; $CKEditor = new CKEditor(); $CKEditor->editor("editor1", "<p>Initial value.</p>"); PHP: just below the php tag add error_reporting(0); note* this may stop the error reporting but won't solve the under lying problem. Try out whatever new function your are adding to see if the code is effective. If injecting edited text/img to a BD there may be problems given the under lying problem, try anyway to see if all is functional. I've used error_reporting(0) on an old php 4 PR checker on xampp and it's functionality seems to be working. Last time I utilized ckeditor was about two years ago for one of my CMS modules, (I've switched to tinymce since then) so I'm not 100% up to date on their modules. give it a try anyway.
OK I'll try to use your script - tinymce what is the php that create the editor? by the way - is it possible to do COPY PASTE to image with it?