Forum Moderators: coopster

Message Too Old, No Replies

generate a gif with text for deterrence

         

stanza

12:41 am on Feb 19, 2005 (gmt 0)

10+ Year Member



When you sign up for account in yahoo or gmail, they ask you to look at a gif file and type the letters from it. This seems to be useful for deterring hackers who write a bot to automatically sign up for many accounts.

Is it possible to do the same thing in php? If so, any existing libraries? Do I need to put any DLL for extending the PHP? (If not it's the best, because my site is hosted.)

Any other techniques for deterring malicious bots?

Thanks!

NickCoons

2:34 am on Feb 19, 2005 (gmt 0)

10+ Year Member



There are image-generating functions in PHP.. look them up at php.net and you will find a list of all of the supporting software that's needed. It's possible that your host already has these installed and configured, and all you'd have to do is write the script.

I've used these same functions to create weather buttons on-the-fly.. they work very well and are easy to use.

ogletree

5:18 am on Feb 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



DO a search for captcha or captcha php.

hakre

7:41 am on Feb 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



tell that guy the truth, it's in the pear package and all build-in-ready:
[pear.php.net...]

that should do the job even if it's alpha.

mincklerstraat

9:45 am on Feb 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you know, David Sklar just gave a talk "11 Cool things to do with PHP", using PEAR CAPTCHA was one of the 11 cool things:

[sklar.com...]

henry0

12:03 pm on Feb 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



mincklerstraat
very interesting link

now about part 1)?

is there a tutorial on generating those images
it uses a random (), some img create .... but where should I look to find more details about it?

thanks

mincklerstraat

7:38 pm on Feb 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For part 1, actually making the images, if I was doing it, since I'm lazy, I think I'd just copy the text in the link above and try it out, and once I get it working, try to incorporate it in my script somehow.

PHP gives you a bunch of options for random-ish types of numbers; a tutorial for doing this would introduce you to random numbers, introduce you to gd, things like imagettftext, imageline, and imagerotate; it'd show you how to figure out some parameters for limiting possible results so your image is as human-readable as possible, and as machine-unreadable as possible, 3 different things really.

The CAPTCHA people have done quite some work in trying to figure out the last bit, and I'd assume that the package makes use of their work so you don't have to go reinventing the wheel.

In David Sklar's example code, the only thing that immediately sticks out to me as something you'll want to change is the font name. You'll want to have this font installed in the correct directory - the PEAR CAPTCHA class docs should tell you where that's supposed to be, or maybe they just assume a relative uri from the calling script.

henry0

8:00 pm on Feb 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thank you
I will check it out
I have no problem with random and others
but I should spend some time with GD

although the package sound a good deal!