The following script will take your variable $comments and filter out any bad words. eregi_replace is case-insensitive, so it will take out the word, no matter the way it is input.
Yeah, it's a good idea, but I think that just replacing the entire word with one character is neater so you can see the length of the character (and guess what it is if you really need to know what it was :p).
Watch out when filtering curse words. If the text submitted handles text formating like <b> tags (or b wrapped in brackets like this and other forums do), I could easily do something <b>s</b>hit and it would spell out you know what with the "s" in bold. I think this is a bug in vBulletin. I know I tried it on a few forums and it worked.
couldnt you just do striptags() and/or mysqlescapestring()
this should filter off tags, or you could custom code a bb code like parser so that it replaces <b>, etc. with nothing.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.