Page 1 of 1
profanity filter
Posted: Thu Jul 03, 2003 5:38 pm
by croskerry
I am writing a standard guestbook application. However, I have to make absolutely sure that no profanity appears on this particular site. I could have the entries sit in the DB and wait to be approved by me but that would mean a lot of work on my part.
Does anyone know of a script that filters out dirty words? If not, how about a list of dirty words that I could filter against?
Thanks,
Dan
Posted: Thu Jul 03, 2003 5:49 pm
by qads
uh...don't think i am allowed to post 500 sickest word you can think of here

.
what you could is to have a table with all the words you want to replace, e.g.
field 1: ASP
field 2: A*P (asp is a bad word for me

)
then u can use php to replace words when a enerty is subbmited or soemthing...quite easy, i made it few days ago but don't have now.
OR you can post your email address here and people will send you so many words that you'll pass out lol....
even better!, make a form for people to enter words which thery think are "bad", let them put into the table, this way you will get a VERY big list of words........or something
i have't slept for 32 hours so this prolly won't make much sense.....good luck.
Posted: Sun Jul 06, 2003 5:12 am
by m3mn0n
Do what i do, filter before it goes into the database.
Code: Select all
<?php
$badword = "bitch";
$filter = "female dog";
$Array["MessegeBody"] = eregi_replace($badword, $filter, $Array["MessegeBody"]);
?>
Store all your words and replacements in a database and loop this snipplet calling out all the things from the DB in the right place and you have your very own word filter.
Note: This can be used for a smilie/bbcode type thing too.
Code: Select all
<?php
$bbcode = ":wink:";
$replace = "<img src="images/wink.gif">";
$Array["MessegeBody"] = eregi_replace($bbcode, $replace, $Array["MessegeBody"]);
?>
Enjoy.
