PHP Form Captcha
Product Overview I View Demo I Form Captcha Manual I Order PHP Form Captcha
PHP Form Captcha
Version 1.0
"Best way to prevent automatic submission to your form"Table of contents:
- PHP
- GD library (built-in PHP 4.3.2 or later version) to get help installing GD please click here
- An HTML or PHP web form
- PHP processing script to process your form
- No MySQL is required.
Installing the PHP Form Captcha is a very easy process, and only takes around 5 minutes from start to finish. Our installation routine has been designed with the novice in mind to ensure an easy installation..
- Please UnZip the package you received .
- Now that you have the files unzipped on your computer, you need to upload them to your server into the same directory of your web form
IMPORTANT NOTE:-
Did this title grab your attention? Good! It should really do! Please read on ...
You should be 100% sure that the files config.php, captcha.php, captchalib.php, check.php and the subdirectory admin are exists in the same directory of your web form
Give read/write permissions to the file config.php , this file will include your preferences, it needs to be accessible for reading and writing operations that can be done easily by right click on it and select properties
- Open the admin page on your browser at: .. /admin/admin.php (i.e http://your-server-name.com/path-To-your-form-directory/admin/admin.php)
- You should see a login area, please use the following login info : username : admin password: admin
- Enter the URL of the form you want to secure in the "Form URL" field, the first field in the admin page, then you need to change the login info of the admin page by adding new username and password in the "Admin login info", the last section of the admin page.
- Now open the form you want to protect , add the following HTML code somewhere inside the <form> and </form>
Enter the code shown <input type="text" name="pfw_security_code" size="20"><p><img border="0" src="captcha.php" ></p> the above HTML code will generate the captcha picture which include the distorted text appears in your form along with a text box for your visitor to enter the security code he sees in the picture.
Open your form processor file , it's name should be mentioned in the "action" parameter of your <form> tag, please add the following PHP line at the top of the file just after the "<?php" line or after the validation code if you are aware of PHP scripting
require_once("check.php"); Now open your form in the browser , you should see the captcha image, if you don't see the image please click here , the distorted text should be changed whenever you refresh your form , try to enter an invalid security code and see weather or not the error message appears correctly then try to add it correctly and see what happens , To change size, font, border, error message mode please display the admin page and make any changes you like at ../admin/admin.php
The administration page is used to change the characteristics of the captcha system so that you may tailor it to meet your expectations, the admin page includes 5 important sections :
- Form properties (it's important to add the URL of your form only if you need the error message, which should be displayed to your visitor when he incorrect security code, appears in the same page of your form)
- Captcha image properties : this section allow you to change the width, height , border and font of your turing image to fit your template.
IMPORTANT NOTE:-
To change the font of the turing text , you need first to upload the font file in the same directory of your form then add it's name in the "Font file name"
- Error Alert properties : in this section you control how the error message which should be displayed to your visitor when he enters invalid security code, there are 3 options for how to show the error message :
- Error message appears in a new page generated by the form captcha , the error message you set appears on this page
- Error message appears in a new message you creates, in this case you need to generate a web page and type it's URL in the "generated error page".
- Error message appears in the same page of your form , in this case you need to add the following tag in your form page in the place that you want the error message to appear at :
<!-- error alert goes here -->
- Success page: After processing the form normally the form possessor should direct your visitor to certain page where a thank you message displayed , Form captcha is not a form processor it only protect your form from automatic submission but however if you need it to direct your visitor somewhere after code verification you should check the "direct to success page" box and add the page URL in the "success page"
IMPORTANT NOTE:-
the above feature is not recommended unless the form doesn't make anything other than checking the security code which is very rare..
- Admin login info : setting the login info of the admin page , you shouldn't enter a password unless you want to change the existing one.
Q: I don't see the turing picture in my form ?
A: This might happened if you try to open the form on your computer by just double clicking the form file, this wont display the image because it is created by a PHP script need to be run on your server, you need to share the folder which contain the form in your PC, then open your browser and type http://localhost/folder-name/form-name.html or simply upload the form ,type the URL of it in the address bar of your browser.also you need to make sure that
- Your form is in the same directory of the files "config.php", "captcha.php", "captchalib.php" the font file "CENTURY.TTF" and the sub directory "admin" .
- You need to be sure that you add the code which display the image (step 7 in the installation) within the <form> </form>
Q: Can turing text be case insensitive?
A: Yes, All you have to do is display the admin page at /admin/admin.php and uncheck the "sensitive security code comparison" box .
Q: Can the size of turing image and length of security code be changed?
A: Yes, you can change size , font , border and code length from your admin pageIf you still have any question please contact us at support@tools4php.com , we will respond within one business day .













