Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A poor man gotCha routine 1

Status
Not open for further replies.

southbeach

Programmer
Jan 22, 2008
879
US
I just put together a simple but friendly gotCha routine. In my site, I constantly get garbage posted to and have for a long time wanted to implement a gotCha process to fight the robots off.

I have finally spent a bit of time and did something about it.

For those of you looking for something easy to implement and, I think, secure enough visit
Code:
[URL unfurl="true"]http://www.fpgroups.com/index.php?Target=code[/URL]

Look for the snippet entry titled
A gotCha routine for your PHP forms

I am including an explanation, sample code and the images. Check it out and tell me what you guys/gals think.

Regards,


--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
i'm increasingly using ajax to deliver a hidden nonce to a form a few seconds after load. most robot scripts will not parse the javascript, and those that automate a browser, will have scraped, filled and submitted the form before the ajax delivers the nonce.

agreed: it does not work if js is turned off. but i think that this is increasingly less of a concern for developers than it used to be.

the best thing about my method is that there is no material barrier to entry for users. I get very switched off by CAPTCHA implementations.
 
Hi

Nice idea jpadie [medal]. I will implement it as an alternative to the captcha : if AJAX succeeds, then JavaScript will remove the captcha from the form, else the user still has to type in the obfuscated text.

Feherke.
 
Ooh, it is CAPTCHA not GOTCHA - I 'got' it now. [bigcheeks]

--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
i have posted a sample class for this (without feherke's twist of using the images too) on my site:
on the images side of things, rather than create a bunch of pre-images i think i would rather create a random charset on the fly, apply some random transformations and then assemble the characters on a png background and deliver that to the browser. if i have time over the coming few weeks i'll post something for the image manips: i have not played with the GD library for some time!
 
Very slick jpadie - I like that idea.

Just to add to info about CAPTCHAs, I use reCAPTCHA on several web forms and have received zero spam since implementation, and it digitises books in the process.

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top