chrishau Posted October 18, 2006 Share Posted October 18, 2006 Hey! I have a problem... I have a tagboard on my homepage - www.dagangstas.net and it constantly gets filled up with spam so I deciced to do something about it and I want to create a filter that checks the tags for spam words. But I am not sure how.. Here is what I have so far![code]$cjmsg = $_POST['cjmsg'];$spam_array = array('breast enlargement', 'penis enlargement', 'weight loss', 'Incest Sex', 'Hentai Porn', 'Lose Weight', 'Free Money', 'Credit card', 'green card lottery', 'Viagra');function contains_spam($spam_array,$cjmsg) { foreach ($spam_array as $spamitem) { return true; } return false;}[/code]As you can see the spam_array contains the words I want to ban and $cjmsg contains the tag. How can I check the words in $cjmsg against the spam array? Any help would be appreciated!! :) Quote Link to comment https://forums.phpfreaks.com/topic/24308-checking-text-field-for-spam-words/ Share on other sites More sharing options...
.josh Posted October 18, 2006 Share Posted October 18, 2006 [code]$cjmsg = $_POST['cjmsg'];$spam_array = array('breast enlargement', 'penis enlargement', 'weight loss', 'Incest Sex', 'Hentai Porn', 'Lose Weight', 'Free Money', 'Credit card', 'green card lottery', 'Viagra');if (in_array($cjmsg, $spam_array)) { // prevent update} else { // do the update}[/code]though you should know..that's about as rudimentary as it comes... people can do all sorts of things to get around that, like doing V i a g a r a V..I..A..G..A..R..A etc.. so you're going to have to do better than that.. Quote Link to comment https://forums.phpfreaks.com/topic/24308-checking-text-field-for-spam-words/#findComment-110563 Share on other sites More sharing options...
chrishau Posted October 18, 2006 Author Share Posted October 18, 2006 Thanks!I know it is not the most advanced solution...but the battle has to begin somewhere right? :) Quote Link to comment https://forums.phpfreaks.com/topic/24308-checking-text-field-for-spam-words/#findComment-110566 Share on other sites More sharing options...
xsist10 Posted October 18, 2006 Share Posted October 18, 2006 If you want to be really fancy you can send any board posts as an email to your webserver (with subject line: board_post or some such) and let your spam software (spamassassin, etc) sort it out. Then collect the email with a cronjob and post it.Have a Google around and see if any anti-spam tools are out there that you can use on plain-text. There must be a few.Otherwise just ban the IPs of the people who are posting spam. Quote Link to comment https://forums.phpfreaks.com/topic/24308-checking-text-field-for-spam-words/#findComment-110570 Share on other sites More sharing options...
chrishau Posted October 18, 2006 Author Share Posted October 18, 2006 Thanks :)Tried banning the ip's but they keep changing.. and tried sending mails to their providers aswell but nothing really happening there so will keep on trying! Quote Link to comment https://forums.phpfreaks.com/topic/24308-checking-text-field-for-spam-words/#findComment-110574 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.