Results 1 to 25 of 103
Dec 7, 2012, 08:53 #1
- Join Date
- Oct 2012
- 2 Post(s)
- 0 Thread(s)
Simple PHP math captcha to minimize bots sending you junky emails?
We have built a responsive site using Twitter Bootstap, only to find that off-the-shelf Contact Forms don't work so well with responsive designs
I also discovered that all webhosting services handle transmitting emails from Contact Forms in different ways.
I use Yahoo Webhosting (which is great) and for that service your form's action is a specific URL that processes and emails you the form's content. Their system is sort of a "closed circuit" that supposedly can only send emails to the address you designate in their Web Hosting Control Panel. So with Yahoo there is no need to take extra steps to prevent your Contact Form from being hijacked (or so they tell me...)
But it has no method of stopping bots from using your own form to send junky emails to you. That's what I'm hoping you all can help with...
The methods I have discovered are:
1) turning off autocomplete on the form
2) using unconventional phrases or random numbers for name="xx" and id="xx" ( like "online-address" instead or "email")
3) using some sort of question/answer system to make sure they are humans not bots ( like "Which animal barks? Dog or Cat?")
So on this test page... http://easydigging.com/Contact/Contact-4.html
...I have a Contact Form that is wide open. As long as you put something in at least one of the fields it will transmit an email. (Yes, we are OK with people not filling out all the fields)
I have already done Steps 1 and 2, but really need help with step 3.
A) the method currently in place is supposed to check for the number 12 (in answer to 6 + 6 = ?), but it doesn't work. I tried modeling it off the approach in this article: http://alittlecode.com/files/jQuery-Validate-Demo/#html Maybe I screwed up the equalTo part, or just am not calling the JS properly?
B) use a few Radio Buttons with a multiple choice question. Like this article: http://stackoverflow.com/questions/6...nswer-in-array
Either way, we also need to somehow prevent the email from being sent until the answer is correct. I thought of maybe hiding or disabling the Submit button until the correct answer is entered (but have no idea how to do so)
Or even submitting the form as soon as the correct answer is entered (which may work really really simply with the radio button idea if it doubles as a stealth Submit button...)
Any help or ideas is greatly appreciated