Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Accessible CAPTCHA?

Reply
Thread Tools

Accessible CAPTCHA?

 
 
Leif K-Brooks
Guest
Posts: n/a
 
      02-20-2004
I'm building a site which will have forms which must be protected from
bots. The obvious solution is to use a CAPTCHA of some sort, but it
needs to be accessible so images are out. The best solution seems to be
some sort of logic, but it will be open source so something fairly
complicated is needed. Any suggestions?
 
Reply With Quote
 
 
 
 
Toby A Inkster
Guest
Posts: n/a
 
      02-21-2004
Leif K-Brooks wrote:
> I'm building a site which will have forms which must be protected from
> bots.


What kind of bots? Malicious bots or well-meaning-but-misguided bots. If
the latter, then robots.txt should be your friend. If the former, then
keep reading...

> The obvious solution is to use a CAPTCHA of some sort, but it
> needs to be accessible so images are out. The best solution seems to be
> some sort of logic, but it will be open source so something fairly
> complicated is needed. Any suggestions?


Ask a simple question at the end of each form, but choose the question to
ask from a huge pool of questions. Example in Perl...

Part of the code that contructs your form:

# make sure questions.txt cannot be accessed directly by browsers
open(QA,"questions.txt");
$i = 0;
while($qa = <QA>) {
chomp $qa;
($q,$a) = split(/\|/,$qa);
$Q[$i] = $q;
$A[$i] = $a;
}
close(QA);
print qq!<input type="hidden" name="qnum" value="$r">\n!;
print q!<p><strong>Question:</strong> ! . $Q[$r] . qq!<br>\n!;
print qq!<input type="text" name="a"></p>\n!;

Part of the code that handles form submissions:

# I'm assuming you've taken your GET or POST variables and put them in
# a hash called %invar.
open(QA,"questions.txt");
$i = 0;
while($qa = <QA>) {
chomp $qa;
($q,$a) = split(/\|/,$qa);
$Q[$i] = $q;
$A[$i] = $a;
}
close(QA);
$ProbablyABot = 0;
if( $Q[$invar{'qnum'}] ne $invar{'a'}) {
$ProbablyABot = 1;
}

Where questions.txt consists of many lines like:

If I have two apples and 3 pears, how many pieces of fruit do I have?|5
What is the number after nine?|10
Red, blue, green, yellow. How many colours were in that list?|4
How many days of the week start with the letter 'S' in English?|2
etc, etc, etc...

On second thoughts, you probably don't want to pass "qnum" in the form:
rather attach it to some kind of session ID.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

 
Reply With Quote
 
 
 
 
Safalra
Guest
Posts: n/a
 
      02-21-2004
Toby A Inkster <> wrote in message news:< >...
> [snip - on the subject of human input validation]
> What is the number after nine?|10


Hmm... it's 0 on my keyboard. Sounds stupid, but you just know some
user'll be confused by it and complain to technical support...

--- Safalra (Stephen Morley) ---
http://www.safalra.com/hypertext
 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Computer not accessible. Network path not found =?Utf-8?B?Q2F0aHk=?= Wireless Networking 15 05-10-2011 09:09 AM
workgroup is not accessible =?Utf-8?B?UG9vYg==?= Wireless Networking 0 07-28-2005 05:35 AM
workgroup computer not accessible =?Utf-8?B?Y21vcmE=?= Wireless Networking 2 07-18-2005 05:00 AM
network not accessible =?Utf-8?B?QmVuQXJ0TQ==?= Wireless Networking 4 07-03-2005 04:14 AM
network is not accessible =?Utf-8?B?QWlkYW4=?= Wireless Networking 2 03-25-2005 11:57 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57