EchoFool Posted October 8, 2010 Share Posted October 8, 2010 Hey My site is getting alot of spam and i need a way to keep up with what is being sent with some kinda system that will flag things which contain urls and chosen keywords. Problem i faced though was lets say a keyword was: skyspider Now some one could say sky or spider (as seperate words) but they still flagged. So "theres a spider in the sky" would be flagged when i only want "skyspider" flagged... does that make sense? What php function do i require to do such string checks like this? Thanks Quote Link to comment Share on other sites More sharing options...
EchoFool Posted October 8, 2010 Author Share Posted October 8, 2010 Sos thought i added the script to my post: function Filter($text) { // fill this array with the bad words you want to flag on $bads = array ("badword1","badword2"); // we are just checking $i = 0; while($i < sizeof($bads)) { // go through each bad word if(eregi($bads[$i],$text)){ return 1; echo 'flag'; }Else{ return 0; echo 'no flag'; } //if we find any, return 1 $i++; } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.