I have a form on my site which is processed by a php script. What I require is to add on a image verification entry before the form is 'submitted'. This is to prevent spamming. The obvious answer is implementing Captcha. Is there ready made and good php code out there that I can use to implement in my form / script ? would appreciate any feedback. thanks CC
i found a example of the same i dun remember exactly. you can search for "captcha" in planetsourcecode Thanks
Animated captcha (with example files) http://planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=2382&lngWId=8
[QUOTE> The obvious answer is implementing Captcha. Is there ready made and good php code out there that I can use to implement in my form / script ? [/QUOTE] I know this is unsolicited advice but I thought I'd pass it along anyway: PHP is definitely what you need. That Captcha scripts, well, maybe not so much for few reasons (IMO/IME): 1. Capcha images can be difficult to make out the code for those with good eyesight, let alone less than 20-20 eyesight or color blindness, for instance. 2. Some people just plain don't like it and won't use it, so if you don't mind losing those who are less-determined to send a mail, it might be OK. 3. IMO make the captcha image/validation happen FIRST, as an entrance to the actual form. People really hate it when after filling in a form, they come to the captcha image, get the code wrong, and have to go back and do it all over again. So be sure you make their inputs persist long enough to be able to redisplay if they have to go back and try again. For a local non-profit site I manage, I'm in the process of taking out the captcha images and replacing them with an entry page that asks random simple, easy to answer questions instead of the capthca image. Questions rotate, like what year was it one year ago? What day was yesterday? How many feet does a (whatever) have? and a personal question like first name or age. The last two can be sprinkled later in other scripts to verify it's still a human at the controls. And using Back button anywhere re-asks a subset of the original questions; they must still match. It sounds a lot more complicated in words than it really is. Just a few randoms to pick the questions, then store the answers in a session variable, and validate them. There should be very few input errors this way. Enter; answer questions; access to form granted, pop quiz toward end to ask for age, whatever, and send it. I'm considering hiding a captcha image somewhere just for the robots to waste time on if they do make it in. Nothing is 100% anyway; no idea whether my idea is even as good as Captcha but intuitively feels harder to beat, easier to fill in, even for sight impaired since text readers, etc. will still work with it. Capthcha takes a special effort to read the code for sight impaired. My 2 ¢ anyway.
<?php $img_text="text"; $dest="image/code.jpg"; // create a 70*25 image $im = imagecreate(70, 25); // white background and blue text $bg = imagecolorallocate($im, 255, 255, 255); $textcolor = imagecolorallocate($im, 0, 0, 255); // write the string at the top left imagestring($im, 5, 5, 5, $img_text, $textcolor); // output the image imagejpeg($im,$dest, 75); ?> PHP: