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 Link to comment https://forums.phpfreaks.com/topic/215389-please-help-with-my-spam-issue/ 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++; } } Link to comment https://forums.phpfreaks.com/topic/215389-please-help-with-my-spam-issue/#findComment-1120065 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.