Jump to content
Larry Ullman's Book Forums

Cannot Make Ckeditor A Wysiwyg

Recommended Posts

Hi again!


Have downloaded and installed CKEditor. It shows on my add page form ok. I can add text and add the page ok, and the content is safely stored in the database.


However, when the add_page redisplays with the confirmation message, the content appears in the textarea field (CKeditor panel) as plain text together with formatting tags. ie it is not behaving as

a WYSIWYG editor.


How do I get this to display as WYSIWYG content?


PS the allowed formatting tags are correctly stored on the database and the actual page displays properly when I visit it, so this is about getting the $_POST['content'] to display properly in the CKeditor field on the form.


Any clues? Have I failed to install/configure the editor properly, or do I need to manipulate the $_POST['content'] in some way?

Link to comment
Share on other sites

Thank you for your response.


The idea was to adapt the original add_page.php form into an edit form, so that a first draft of a page which was originally entered via the add_page form and stored on the database could be amended/updated. In order to get the stored data to display on the edit form, I was setting it to $_POST['content'], so that when the form loaded, the create_form_input() function would display the content in the editor.


You are right, (of course!), entities are being used. I substituted your mysqli_real_escape_string for htmlspecialchars (mainly because I am not familiar with mysqli. For example, I am using $pdo to connect to the database. After some investigation, I am using html_entity_decode() to return the entities to the corresponding symbols, and the CKEditor is now correctly formatting these and so is a WYSIWYG text editor once again.


Thank you for pointing me in the right direction on this!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...