CF Captcha v0.9

A Simple PHP Anti-Spam Captcha Script based on PHP/GD, to help prevent web robot from flooding your Comments, Guestbooks, Contact forms or any other online application susceptible to spam.

One of the main Features of this script is that it alternates between a simple maths problem (Additions, subtraction and multiplication sums) and a random spring of characters.
Requirements to use this captcha script, you will need PHP enabled on your server with GD extension enabled.

Example CF Captcha

Here is a simple example of how the Captcha will look.


Reload Captcha
Reload Captcha with noise
Reload Captcha with wave
Reload Captcha with noise and wave





Basic Setup Guide

Image
Including the CAPTCHA image is as easy as copying the code below and paste them in the form where you desire it to appear. As can you see below there is a bit of PHP at the end of the image address this is pure to stop the image from being cached making sure the user sees a new image every time they return to the page. The most important part image address is '?img' as this tells the script to make the image.
<img id="captcha_img" src="./captcha/cf.captcha.php?img=<?=time();?>" />
Reload (optional)
This is a optional bit of code which a user may find useful if they can't read the CAPTCHA image, it simply reloads the image and produces a new CAPTCHA code dynamically without having to reload the whole page.
<a href="#" onclick="document.getElementById('captcha_img').src = './captcha/cf.captcha.php?img=' + Math.random(); return false">Reload Captcha</a>
Form
The HTML code below is a example form field for CAPTCHA (setCaptcha).
<label for="setCaptcha">Verification code: </label><input name="setCaptcha" type="text" id="setCaptcha" size="24" />

Validating the CAPTCHA
When the form is submitted, we compare the value in the Cookie(CAPTCHA) with the submitted CAPTCHA code( the value in the text field setCaptcha). If the codes match, then we proceed with form submission. Else we display an error.
<?php
include_once('./captcha/cf.captcha.php');
if(
check_captcha($_POST['setCaptcha'])){
    echo 
'CAPTCHA CHECK: <span style="color:red">'.$error_captcha.'</span>';
    
//exit();
}else{
    echo 
'CAPTCHA CHECK: <span style="color:green">Correct</span>';
    
//proceed
}
?>


Download

Last Updated : 28 April 2010
Download : CF Captcha Version 0.9
If you find any bugs please let me know or if you need any help please feel free to post a comment below and I will answer you as soon as possible.

Information: Comments are closed. Please use the forum

Other Tools

CF Image Host 1.6.5
A simple and easy to use Image hosting script, which aims to make it easy to set-up and...
Prompt For Name
Personalize your page with this very simple Java Script that asks the vistor for his or...
MD4 Hash Generator
Message-Digest 4 is a widely-used cryptographic hash function with a 128-bit hash value.

Forum Topics

I can not remote upload
Upgrade version 1.6.5 but can not remote upload. I get this message: Fatal error: Call to undefined function...
Rilch Enterprise Free hosting
http://img.rilch.tk check us out
Resize not working for images larger than 3300x3300
When trying to upload an image that has to large of dimensions, it will not upload the photo even when trying...
erreur 500 2.4.9
hello everyone, i have downloaded imagehost1.6.5 but on my website (in hostinger.fr) i have a internal server...
ImgCool - The coolest image hosting service
Img Cool is a new image hosting service, please feel free to upload your images, adult content is allowed...