View Full Version : How Preventing HTML Tag go in Database?

09-27-2006, 04:03 AM
I have a some problem. when user maybe suddenly or not inserting some word like "<table>" or some other 'html' or 'java script' tag. this will cause the whole webpage error or display change.

how to prevent this thing?

I try to using regular expression to change the input before save into data base but I'm not good in regular expression syntax. it confuse me T_T

please help ^_^ or any other solution?

09-27-2006, 06:48 AM
strip_tags() (http://us3.php.net/manual/en/function.strip-tags.php)

09-27-2006, 08:16 AM
also look at function htmlspecialtags() (http://lt.php.net/manual/en/function.htmlspecialchars.php)