I am using a WYSWYG text editor in my CMS and when I post the page to save the data, I simply capture the following field and save it to the database as such:
My guess is that it's the WYSIWYG editor doing the conversion, if, in fact, you are not applying htmlentities() anywhere in the data flow.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks