|
|
|
|
![]() ![]() |
Aug 7 2005, 09:56 PM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 407 Joined: 13-December 04 Member No.: 2,696 |
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 appreciated kvarnerexpress |
|
|
|
Aug 7 2005, 10:50 PM
Post
#2
|
|
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,161 Joined: 9-May 05 From: Brisbane, QLD Member No.: 6,818 |
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.)
CODE 'checks for spam Dim spam, spamArray spam = 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 if next You 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. |
|
|
|
Aug 9 2005, 03:27 PM
Post
#3
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 629 Joined: 26-February 05 Member No.: 3,995 |
Here's a PHP version of the above script:
CODE $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(... |
|
|
|
Aug 9 2005, 04:04 PM
Post
#4
|
|
|
Newbie [Level 1] ![]() Group: Members Posts: 10 Joined: 9-August 05 Member No.: 10,510 |
[quote=beeseven,Aug 9 2005, 03:27 PM]
i've the same problem! |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 6th September 2008 - 04:51 PM |