Member
From: South Africa
Registered: 2006-07-21
Posts: 294
I've been thanked 7 times.
Offline
I need to apply a captcha to one of my clients forms.
Can anyone recommend a good one? Here's what I'm looking for...
Must have the following...
- Free
- Good looking & Subtle (not too many gaudy colours & not too bulky)
- Either PHP/JavaScript (not ASP)
- Option to refresh and get another image if current one is bad
- Option to exclude certain letters and numbers (like 0 & O)
Would be nice if it had the following...
- Audio for those with disabilities
- Aesthetics customisable via css
Moderator
From: Yorkshire, UK
Registered: 2006-08-19
Posts: 2818
I've been thanked 81 times.
Offline
no need for an image based captcha - use maths and human sense
pick two random numbers between 1 and 10 and a random operator (+,-,*,/) and ask the user to put the answer to the calculation in the form field.
To perform the validation you must know what the original question was and then check the answer with that submitted
The easiest/crudest way i can think of is to use md5
an example in PHP
as part of the form
Code: php
<?php
$var1 = rand(1,10);
$var2 = rand(1,10);
$op = rand(0,2);
$ops = array('+','-','*'); // I removed '/' to avoid things like 3/7 - ensuring only integers come back!
$expr = $var1." ".$ops[$op]." ".$var2;
eval('$result = '.$expr.';');
?>
echo $expr." = <input type='text' name='auth' />";
echo "<input type='hidden' name='authc' value='".(md5($result))." ?>' />";
?>
Once submitted, check like this
Code: php
<?php
if($_POST['authc'] == md5($_POST['auth'])) {
//ok
} else {
//not ok
}
?>
Moderator
From: Yorkshire, UK
Registered: 2006-08-19
Posts: 2818
I've been thanked 81 times.
Offline
This is also a pretty cool one
http://recaptcha.net/
you get two images, both have been scanned in from a book and parsed through OCR software. The OCR recognised one, but not the other.
You get the user to enter both words. If the word that is known is matched correctly then thats ok.
The other word the user enters is taken to be the deciphered word, correctly spelled and is stored in their database - all in all you are helping to convert books into an electronic format....and you get a captcha!
Administrator
From: Colorado, USA
Registered: 2006-02-15
Posts: 2230
I've been thanked 95 times.
Offline
Here are some I have bookmarked.
Very versatile but takes a little bit to set up.
http://www.dagondesign.com/articles/sec … er-script/
http://www.freecontactform.com/
This has both image and audio
http://www.boutell.com/newfaq/creating/captcha.html
I use one like Northie suggested on my tutorial site.
http://validwebdesigns.com/contactvwd.php
Attention designers and webmasters - "The Beauty of CSS"
Valid Web Designs tutorials on HTML, XHTML and CSS
Home Security Systems
Member
From: South Africa
Registered: 2006-07-21
Posts: 294
I've been thanked 7 times.
Offline
Hey guys. Fantastic! Thanks so much for all the suggestions!
I'm going to look through all of those now and see what fits best.
Member
From: South Africa
Registered: 2006-07-21
Posts: 294
I've been thanked 7 times.
Offline
Ok, so I'm really liking the maths one (freecontactform) which is pretty much what Northie was describing only 99% of the thinking work is done for me. There was just one thing I didn't like, but it was quick to change - I just changed it so that the name is added to the from field instead of just an email address and that's pretty much perfect, so I even added it to my own site.
Thanks again!
| Never |


