CAPTCHA for PERL Uer Notes and Fixes

Thousands of perl developers have downloaded the captcha for perl program and added it to their current programs. Here are a few useful ideas from some webmasters that may be handy in your application of the script.

Windows CAPTCHA Fix - I was clear in the description that I knew nothing about windows and did not know if it would work on that o/s. Apparently, it does work, but according to Jeff, you need a binmode statement added to the captcha.cgi to keep the image from being distorted. Here is what he says:

I came across your captcha.cgi PERL script and noticed that on Windows it generated a garbled verification image sometimes when the form loads. If you add:

binmode STDOUT;

to the captcha.cgi script directly above where you print out the headers
(print "Content-type: image/jpeg\n";) it solves this problem.


Image Reload Problems - Many people have had issues with users backing up and trying to submit the form after a captcha failure, since the old image is cached and there is no file to verify against since there was already a failure, it fails again and again. People don't know what reload or refresh means, so you almost have to do it for them.

Knut from Norway found the answer with a simple java script link to reload the image automatically. Here is what he offers:

<script language="javaScript">

function reloadCAPTCHA() {

            document.getElementById('CAPTCHA').src='captcha.cgi?randomnumber?'+Date();

}

</script>

<a href="javascript:reloadCAPTCHA();">Load New Code</a>