On Fri, 19 Jan 2001 [EMAIL PROTECTED] wrote:
> Hi,
>
> I`m trying to setup a little profanity filter for a client of mine just
> wondered if anyone could offer some advice on how best to handle it. I was
> thinking of going along these lines...
>
> $filter="moron";
>
> if($Name==$filter)
> {
> printf...Javascript you can`t use that etc
> }
>
> Name is passed from a form, the problem is there are going to be quite a few
> words, so how is the best way to store these words. Something like this??
>
> $filter="moron idiot pratt"
>
> And if $Name was sent through as "moron pratt" would it still pick it up??
>
> TIA for any help
>
> Ade
>
Use a database for the words and say "SELECT 1 WHERE LOWERCASE('$name') LIKE
'%'+word+'%'" and count how many rows are returned. No need to re-invent the
wheel.
--
Ignacio Vazquez-Abrams <[EMAIL PROTECTED]>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]