OT - Random Number generator

  • Thread starter Thread starter Mettá
  • Start date Start date
M

Mettá

I'm looking for a way to prevent auto form submissions by adding something
like a random number or character which must match something that comes up
on screen. Anyone know how to do it or where I might find a simple guide?

Thanks
M
 
Usually, this is done by using a JPG or GIF image in the form which contains
a number that the person must put into the form in order to submit it
successfully.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
Thanks Clinton but
I've tried a Google and it came up with loads of number generators but this
is not what I need. I need a gif image that has been created with alpha
numeric characters that the user enters so that bots/auto stuff cannot
bypass the form.

M
 
Well, the image is the easy part. You just create an image with a number on
it. How you validate the number is another story. You could just use
client-side validation (JavaScript) and not allow the form to submit if the
value in the text box is not the number you put into the image. I'm not sure
whether this would prevent all auto-submissions, but it would be the easiest
and simplest way to do it. Another alternative is to use server-side
validation, which would allow you to keep the actual number value out of the
HTML/JavaScript in the page. But I really don't think that would be
necessary.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
Those are called a "captcha" Mettá. There are several methods around most of
which require custom coding. There are solutions that are not as effective
that do not require scripting or custom coding. I've provided a couple of
referrals to help you get started.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

[1] http://www.codeproject.com/aspnet/NoAutoLogin.asp
// I've used this one
[2] http://www.codeproject.com/aspnet/CaptchaImage.asp
 
If the autobot (doing the submission) has JavaScript disabled then
client-side validation will be ineffective, so server-side validation
is required.
 
Good point Ron.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
Back
Top