I am trying to store some HTML created by users with TinyMCE .I am using JQuery AJAX POST to post content to other page . What happens is HTML is having or & than it treats content after that as a new parameter so only content before that '&' is stored to database.Do I have to escape it before posting ?If so how ?
Add a comment
|
3 Answers
I would never save HTML in a database. HTML is presentation; relational databases are for persistence. Save the data and format it as HTML. Keep the two layers separate.
2 Comments
Pit Digger
What if there is some application where user can have their own htm content?There is no predefined template in this case.
DarthJDG
Wordpress or any other CMS? It is quite justified in certain situations.