Hi guys,
Apologies if this has been asked elsewhere Ive done a quick search but couldn't find an answer.
Anyway....
I've just installed CKeditor on a site I'm building and it seems to be working ok except for the fact that it inserts text into my mysql database as encoded html rather than regular html and then when the browser outputs this text it converts the encoded data into regular html that then displays in the browser showing the html tags and none of the styling!?
eg I type:
"This is text"
into the editor and it then inserts
<p>This is text</p>
into the database. Then when the page is called the browser converts the above and outputs the following on the page:
<p>This is text</p>
obviously I just want "This is text" to display on the page.
Does anyone know why this is happening/how to solve it please?
Any suggestions would be most welcome.
Cheers
Confirming i have the same
Confirming i have the same issue
CKEditor seems to be ignoreing the config setting for html entities. I have:
in the conf file, and its still changing everything into entities :/
Hi thanks for the reply.
Hi thanks for the reply.
I don't know whether this will fix it for you but I found that the problem in my case was some code I'd written that was sending my posted data through a function that was converting htmlspecialchars into html entities but then when the page in the browser was pulling info back from the database to display on the final web page it wasn't converting these html entities back again.
I solved it by sending the retrieved data through a php query to convert the html entities back to regular html that the page could display properly.
I used the code below inside the php query that was getting the data from the database - where $body is the variable with the content that had previously been displaying incorrectly.
$body = htmlspecialchars_decode($body);
and this worked so now all displays correctly.
I hope this helps! :)