Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Protecting Web Email Forms
kvarnerexpress
post 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
Go to the top of the page
 
+Quote Post
Tyssen
post 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.
Go to the top of the page
 
+Quote Post
beeseven
post 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(...
Go to the top of the page
 
+Quote Post
squeezer
post 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!
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Email Code(3)
  2. Email Form(12)
  3. Trouble With Emailer.php(5)
  4. Form To Pdf, With Email?(3)
  5. Sending Attachments Using Email Function In Php(2)
  6. Email Server Help Please(0)
  7. Yet Another Problem With A Form Script(6)
  8. Wappymail_v1.50(15)
  9. Email Header Inject Test(0)
  10. Add Users On Email Program With Php?(1)
  11. Protecting My Code(5)
  12. Forms, Text Files, And Php For A Signature Generator.(1)
  13. Email Sending.(1)
  14. [php]simple Flat File Text Manipulator(3)
  15. Trouble With Phpbb Email(1)
  1. Php Email Validation(1)
  2. Php & Forms Question(2)
  3. Restrictions On Php & Forms?(2)
  4. An Interesting Approach To Email Verification...(6)


 



- Lo-Fi Version Time is now: 6th September 2008 - 04:51 PM