By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,740 Members | 844 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,740 IT Pros & Developers. It's quick & easy.

Captcha's

P: n/a
Hello

One web site I have written has a 'register your interest' form which simply
e-mails the data, this is working fine except some people seem to get off on
repeatedly using the form to send phoney data. I guess this is from some
kind of web-bot so I would like to attempt to program around this problem.

One solution is using a distorted image of some letters (CAPTCHA?), however
I was wondering if anybody has chosen a simpler method, and whether my
simple method would be impervious to web-bots?

1/ Generate a random string of letters
2/ Ask the user to select from 3 combo boxes 3 random positions, e.g. select
letters 2, 6 and 7 from LKJIUVBJH.

TIA

Barry Morris

Nov 3 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Tom
I was looking for a captcha class recently myself. phpclasses.org has
several. hn_captcha was my favorite:

http://www.phpclasses.org/browse/package/1569.html
On Nov 3, 8:52 am, David Gillen <Bel...@RedBrick.DCU.IEwrote:
An noise sounding like Barry Morris said:One web site I have written has a 'register your interest' form which simply
e-mails the data, this is working fine except some people seem to get off on
repeatedly using the form to send phoney data. I guess this is from some
kind of web-bot so I would like to attempt to program around this problem.
One solution is using a distorted image of some letters (CAPTCHA?), however
I was wondering if anybody has chosen a simpler method, and whether my
simple method would be impervious to web-bots?
1/ Generate a random string of letters
2/ Ask the user to select from 3 combo boxes 3 random positions, e.g. select
letters 2, 6 and 7 from LKJIUVBJH.Easy to program around, but unless someone actively wants to circumvent it
probably will do the trick.

There are however plenty of easy to plug in captcha libraries out there.
Google is your friend here.

D.
--
/(bb|[^b]{2})/
Trees with square roots don't have very natural logs.
What's the difference between ignorance and apathy? Who knows? Who cares?
Nov 3 '06 #2

P: n/a
"Barry Morris" <no*****************@btinternet.compíše v diskusním
příspěvku news:ei*******************@news.demon.co.uk...
Hello

One web site I have written has a 'register your interest' form which
simply e-mails the data, this is working fine except some people seem to
get off on repeatedly using the form to send phoney data. I guess this is
from some kind of web-bot so I would like to attempt to program around
this problem.

One solution is using a distorted image of some letters (CAPTCHA?),
however I was wondering if anybody has chosen a simpler method, and
whether my simple method would be impervious to web-bots?
CAPTCHA is good if the picture is not too distorted :-)
But you need not use CAPTCHA. I have easier way.

You generate two keys and place in <form>

<?php
$n1 = chr(rand(65, 90));
$n2 = chr(rand(65, 90));
$n3 = chr(rand(65, 90));
$n4 = chr(rand(65, 90));
$n5 = chr(rand(65, 90));
$key1 = $n1 . $n5 . $n3 . $n2 . $n4; # the sequence know YOU only
$key2 = $n4 . $n1 . $n2 . $n5 . $n3; # the sequence know YOU only
echo "<input type='hidden' name='key1' value='$key1'>",
"<input type='hidden' name='key1' value='$key2'>";
?>

After submit you do some check like this

<?php
$key1 = $_POST["key1"];
$key2 = $_POST["key2"];
$k1 = substr($key1,0,1) . substr($key1,3,1) . substr($key1,2,1) .
substr($key1,4,1) . substr($key1,2,1);
$k2 = substr($key2,1,1) . substr($key2,2,1) . substr($key2,4,1) .
substr($key2,0,1) . substr($key2,3,1);
if($k1 ne $k2) {
echo "I don't like robots";
}
?>

This is example only. You can to generate keys containing 50 chars and time
to time you can make changes in PHP code :-)

--

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)

Nov 4 '06 #3

P: n/a
Hello,

on 11/03/2006 07:49 PM Barry Morris said the following:
Hello

One web site I have written has a 'register your interest' form which simply
e-mails the data, this is working fine except some people seem to get off on
repeatedly using the form to send phoney data. I guess this is from some
kind of web-bot so I would like to attempt to program around this problem.

One solution is using a distorted image of some letters (CAPTCHA?), however
I was wondering if anybody has chosen a simpler method, and whether my
simple method would be impervious to web-bots?

1/ Generate a random string of letters
2/ Ask the user to select from 3 combo boxes 3 random positions, e.g. select
letters 2, 6 and 7 from LKJIUVBJH.
Most Web bots hackers would not bother to defeat simple CAPTCHAs unless
the benefits of defeating it as very high.

If you want to have CAPTCHA validation integrated in forms with other
fields that have their own types of validation, you may want to try this
forms generation and validation class that comes with a plug-in to
implement a CAPTCHA control with almost no effort:

http://www.phpclasses.org/formsgeneration

--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Nov 4 '06 #4

P: n/a
Thank you all for the advice, I will look at various and recommended
Captcha's for a solution.

Regards

Barry
Nov 4 '06 #5

P: n/a
I've written an accessible, multiple choice question based captcha,
it's available at
http://system-x.info/?pageid=18&menutree=47

Nov 5 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.