Methods CGI Scripts 4 U

The CaptchaGen script is more like a perl module in that it needs to be 'required' by your main script. When you purchase CaptchaGen you will recieve a basic example script that do this but it is as simple as adding a few lines to the beginning of your main script and then add calls to the respective subroutines as needed.

You can see the example working at, it initially presents the user with a Log In form and once it is submitted it checks the captcha entered is correct. The example does no more but if you have a basic knowledge of perl you will easily see from the code how to incorporate it into your existing scripts.

Including CaptchaGen image in your forms

Adding the Captcha image to your forms can be done in three ways depending on your server and form.:


If your server allows SSI calls then this creates the image in a table row and the text with text box in the next table row. It also loads the relevant javascript needed for the 'Refresh Image' button.

ie : <!--#include virtual="/pathto/yourscript.cgi"-->


If SSI is not an option then it can be called using javascript, this just returns the image and code required when the 'Refresh Image' button is depressed. ie in your form you would have something like:

<form action='/pathto/yourscript.cgi'>
<img id='captchaimage' name='captchaimage' src='/loading.gif'/>
<input type=button value='Refresh Image' onclick='RefreshCaptcha();return false;'>
<tr><th>Type in the characters you see above</th>
Sorry as you do not have javascript enabled you are unable to use the captcha.
<input type="hidden" name="captchacoded" id="captchacoded" value=''>
 <input type="text" name="captcha" id='captcha' />
<tr><td colspan="2"><span id="captchasound"></span></td></tr>
<script src='/pathto/yourscript.cgi?jscaptcha=1' type='text/javascript'></script>

Which will return :

Type in the characters you see above

From within another perl script

If your form is generated by a perl script you can 'require' the CaptchaGen script and call a subroutine which will return a code. Use this code to link to the image generated. See the 'captchagenexample.cgi' example included with the script or take a look at the Installation Instructions.