dont want html displayed

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
psychotomus
Forum Contributor
Posts: 487
Joined: Fri Jul 11, 2003 1:59 am

dont want html displayed

Post by psychotomus »

should I stop html from even being entered into the sql database or should I just strip the html before being outputted to the page?
User avatar
xinnex
Forum Commoner
Posts: 33
Joined: Sun Jan 07, 2007 7:38 pm
Location: Copenhagen, Denmark

Post by xinnex »

As a general rule, HTML has no place in the database.

That said, there are situationens where it makes sense.
If you are going to do this, then I would advise also storing a "clean" version of the text (stripped from html-tags).

And yes, escape it..
Post Reply