kvarnerexpress 0 Report post Posted August 7, 2005 i have a web form on my site which can be filled in with a customers email, name and question or comment. when the form is submitted an email is sent to an address i setup with all the info.recently i've been getting alot of spam/junk coming from the web form. for the most part, they usually come pretty close together, which makes it seem like just one spammer (at least at a time). also i'm talking like 5-10 messages at a time. i'm wondering if people have any suggestions how to protect these types of web forms from spammers.any ideas/help is appreciatedkvarnerexpress Share this post Link to post Share on other sites
Tyssen 0 Report post Posted August 7, 2005 I was getting a similar thing from one of my forms. All the spam was coming from online gaming sites and they kept copying their keywords into all the fields. So I set up a filter on the commonly used spam words and now I don't get it any more. (This was done in ASP, but the method will be the same for PHP.) 'checks for spamDim spam, spamArrayspam = false spamArray = Array("poker", "viagra", "texas", "xanax", "holdem")for i=0 to 4 if (InStr(Request.Form("message"),spamArray(i)) > 0 ) then spam = true end ifnextYou put the words you want to filter out into the array, then loop through the relevant field (in my case, the message field) a few times to see if any of those words are present. If they are, spam = true and the email doesn't get sent. Share this post Link to post Share on other sites
beeseven 0 Report post Posted August 9, 2005 Here's a PHP version of the above script: $spam = false;spamArray = array("poker", "viagra", "texas", "xanax", "holdem");for($x = 0; $x < count($spamArray); $x++){ if (substr_count($_POST['message'],spamArray[$x]) > 0 ) { $spam = true; }}if(!$spam) mail(... Share this post Link to post Share on other sites
squeezer 0 Report post Posted August 9, 2005 i've the same problem! Share this post Link to post Share on other sites