pnh73
asked on
Stop Mass Signups? PHP Form Security Checks?
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
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
ASKER
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).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=739&lngWId=8
Thanks
Paul
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/l
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