Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-11-2011, 03:45 PM   PM User | #1
Blackecho
New to the CF scene

 
Join Date: Nov 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Blackecho is an unknown quantity at this point
Contact page with captcha

I am working on this site: http://oneclickelectronics.com and I need a contact form integrated with recaptcha or some kind of simple captcha service that would prevent spam to my email. I have some knowledge of PHP but am unfamiliar with integrating a captcha service into a contact form. I am open to all suggestions. I am not sure what captcha services are out there to choose from. But I am looking for a simple free alternative. I do not want to use a premade contact form because I want to learn how to do this. Thank you to all who help
Blackecho is offline   Reply With Quote
Old 11-11-2011, 04:05 PM   PM User | #2
myfayt
Senior Coder

 
Join Date: Apr 2010
Posts: 1,156
Thanks: 46
Thanked 95 Times in 94 Posts
myfayt can only hope to improve
This is one of the many free ones that is recommended by many.
http://www.google.com/recaptcha

Also you can easily create your own simple one, such as this

PHP Code:
if (isset($_POST['submit')) {
$captcha $_POST['code'];

if (
$captcha != 20) {
//Error Captcha is wrong
}

}

What is 10 10?<br />
<
input type="text" name="code" value=""><br />
<
input type="submit" name="submit" value="Send Mail"
It's extremely simple and once bots learn the value it won't be good, but it's suggested that you have multiple ones and use the random function to auto change them per refresh or visit, that way it goes through like 5 different choices,

another idea would be to create a select box with like 20 options, and be like "What was the First President of the United States?" and have silly answers and the right one George Washington.

So there is many ways of doing it, such as craigslist new way of entering the right code, and then copying the text into another box to prove your human.

One more thing to mention if you have a max attempt of tries that would greatly help. Such as 3 or 5 tries and then you can't try again for like 15 minutes. It's annoying to some people, but it does help spam.
__________________
Been a sign maker for 5 years. My business:
American Made Signs
myfayt is offline   Reply With Quote
Old 11-11-2011, 06:38 PM   PM User | #3
MattF
Senior Coder

 
Join Date: Jul 2009
Location: South Yorkshire, England
Posts: 2,322
Thanks: 6
Thanked 304 Times in 303 Posts
MattF will become famous soon enoughMattF will become famous soon enough
http://www.phpcaptcha.org/
MattF is offline   Reply With Quote
Reply

Bookmarks

Tags
contact, form, php

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:45 PM.


Advertisement
Log in to turn off these ads.