View Single Post
  #3 (permalink)  
Old 11-07-2007, 04:57 PM
niggles niggles is offline
WebProWorld Member
 

Join Date: Oct 2005
Posts: 34
niggles RepRank 1
Default Re: Check data before insert database

If you're doing it for security reasons then it gets a lot harder as there's numerous ways of encoding those characters which will bypass most filtering techniques - check out some XSS tutorials to see just how many there are *sigh*.

I agree with imvain2 that strip_tags is probably the easiest way of stripping the tags out.

To be really safe though you could do a regex which only allows Alpha and Numeric characters to remain.

Cheers,
Niggles
__________________
-------------------------------------------------
World Music World - bringing the World's Folk Music Cultures Together
http://www.worldmusicworld.com/
-------------------------------------------------
Reply With Quote