Solved

Stop Mass Signups? PHP Form Security Checks?

Posted on 2003-10-29
4
323 Views
Last Modified: 2008-02-26
Hi,

I was wondering where anyone can advise me how I would go about stopping automated signups for in PHP. I have seen systems where the script generates an image and the user types in the code that can be seen in the image.

I have searched the 'net but cant seem to find anything...

How do I do this?

TIA
Paul
0
Comment
Question by:pnh73
  • 2
4 Comments
 
LVL 2

Expert Comment

by:scully00000
ID: 9641289
If you are running PHP on Linux:

1. Get Zlib from wherever you get your libraries from (e.g. www.redhat.com). Install it.

2. Get libpng and install it.

3. Get Freetype and install it.

4. Compile the GD library.

5. Recompile PHP with the following options:
--with-gd=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/local --with-zlib-dir=/usr/local (replace /usr/local with wherever you installed the libraries)

Check PHP works.

Add a function like this:
function randomimg($numstring)

{
$im = ImageCreate (300, 40);
$grey = ImageColorAllocate ($im, 230, 230, 230);
$black = ImageColorAllocate ($im, 0, 0, 0);

ImageTTFText ($im, 20, 0, 10, 25, $black, "arial.ttf", $numstring);

ImagePng ($im);
ImageDestroy ($im);
}

Generate a random number string by your choice of method and pass it to this function.

Cheers
0
 
LVL 1

Author Comment

by:pnh73
ID: 9641749
I need a way of doing that doesnt require a linux base or a recompile of PHP as I will probably be serving the site from shared hosting and maybe not even off Linux (much to my dislike, but its the choice of my client).
0
 
LVL 11

Accepted Solution

by:
shmert earned 50 total points
ID: 9643063
Do a google search for "CAPTCHA".  http://www.captcha.net/

Note to scully:  I think a good captcha system will distort the images some, so OCR (Optical Character Recognition) systems can't decipher the image.  One low-tech way to do it would be to create your own alphabet of scrambled images, and then assemble them using <img> tags.  Just don't name the images anything obvious like 's.gif' or something.

Then, display a string of these images which spell out a word, and have the user registering type in the text to authenticate that he is, in fact, human.
0
 
LVL 1

Author Comment

by:pnh73
ID: 9645329
After a little bit more searching with the aid of the post from shmert i found the follwing which looks like it will work :D

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=739&lngWId=8

Thanks

Paul
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now