This project provides the SimpleCaptcha class.
Basic example:
session_start();
$captcha = new SimpleCaptcha();
// Change configuration...
//$captcha->wordsFile = null; // Disable dictionary words
//$captcha->wordsFile = 'words/es.txt'; // Enable spanish words
//$captcha->session_var = 'secretword'; // Change session variable
$captcha->CreateImage();
... will output: You can validate the php captcha with:
if (strtolower(trim($_REQUEST['captcha'])) != $_SESSION['captcha']) {
return "Invalid captcha";
}
More examples
Background and foreground colors, dictionary words, non-dictionary random words, blur, shadows, JPEG and PNG support:The images are similar to google captchas.
link: http://code.google.com/p/cool-php-captcha/
No comments:
Post a Comment