FORUMS: list search recent posts

Blocking the 7 Nasties

COW Forums : Web Design

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
IceCreamManBlocking the 7 Nasties
by on Sep 9, 2007 at 2:59:31 am

I'm programming a forum with PHP and want to make it so that if someone writes one of the seven nasties it wil display ****, substitute words, or just not at all. Any thoughts?

Thanks

The "Ice Cream Man"


Return to posts index

AbrahamRe: Blocking the 7 Nasties
by on Sep 10, 2007 at 2:53:13 am

I'd do some thing like this

<?
$cuss_words=array("word1","word2","word3");
$message=str_ireplace($cuss_words,"****",stripslashes($_POST["message"]));
?>



Abraham


Return to posts index

IceCreamManRe: Blocking the 7 Nasties
by on Sep 10, 2007 at 7:10:31 pm

Oh cool. Would this go on the page that's inserting the message into the database?

Thanks for your help.

The "Ice Cream Man"


Return to posts index


AbrahamRe: Blocking the 7 Nasties
by on Sep 10, 2007 at 7:58:53 pm

It's up to you how you want to filter it. You could consider not filtering until you display the contents or if you know that you don't want to save the words then you can filter before. Either way it will work.

Abraham


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]