Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I want to save my text with html formatting in my MySql Database. If I save html formatting in database, will it make my site vulnerable or not?

And What data type should I choose for that particular field in which I need to save my html formatting.
Posted

If you're handling the html as normal text and using parameters then you should be quite safe.

For the data type you can use text. For more info see: http://dev.mysql.com/doc/refman/5.0/en/blob.html[^]
 
Share this answer
 
Comments
rashidfarooq 23-Mar-11 2:29am    
Thanks for Answering
Wendelius 23-Mar-11 3:08am    
You're welcome :)
Use html encoding and may be convert to base64 string

will it make my site vulnerable or not? Yes. Javascript injection is possible.

And What data type should I choose for that particular field in which I need to save my html formatting. = Would be a blob
 
Share this answer
 
v2
Comments
rashidfarooq 23-Mar-11 2:29am    
Thanks for Answering
Albin Abel 23-Mar-11 2:42am    
You are welcome RashidFaroog

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900