CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Profanity / swear word filter recommendations?

Print topic Send  topic

Author Message
SteveG

Posts: 56
Posted: 02/18/2005, 9:15 AM

I'd like to put a filter into my discussion board, something which will replace dirty words with ***'s - or something like that (watching out for B_A_D words too). I haven't done much yet to build the tables yet, so almost anything goes for now.

I briefly looked around the net for php scripts to do only this, but most are integrated into larger projects like chat and discussion boards. Does anyone here have any recommendations of what works well for doing this? Once we're at it, does anyone know where to download all those word and word combinations?

Thanks,

- Steve
View profile  Send private message
klwillis


Posts: 428
Posted: 02/18/2005, 10:35 AM

You can start by learning more about how
to use this PHP function ...
bool ereg ( string pattern, string string [, array regs])

You may also want to add a disclaimer to your discussion board
with a warning that states any use of profranity results in immediate
account cancellation.

_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"

Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006
View profile  Send private message
feha


Posts: 712
Posted: 02/20/2005, 12:55 AM

Here is my custom function:

//################################################
// NO BAD WORDS
//################################################
function no_bad_words($input_text,$bad_words_array)
{
// BY WWW.VISION.TO

$match=array("-","*","'"," ","!","=","+","?","£","@");
$clean=str_replace($match, "", $input_text);
$STOP_BAD_WORDS=explode("|",$bad_words_array);
for($i=0;$i<count($STOP_BAD_WORDS);$i++)
{
if (eregi(trim($STOP_BAD_WORDS[$i]),$clean))
{
return $STOP_BAD_WORDS[$i];
}
}
return FALSE;

}

it will detect B A D or B-a-D or B--A---D etc ....

array should be | separated ....

Note this is not to replace it is to detect ...
you can modify it the easy whay to replace words ...

I use it to not let people even to enter particular words ...
Used on:
http://www.vision.to/new_cms/Links_MOD/Add_Link.php


_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.