Skip to content

ali-khalili/simple-captcha

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple PHP CAPTCHA script

This packaged is modified version of simple-php-captcha.

This code is the object oriented version of the original code.

I also tried to do minor improvements (dynamic path for fonts and background images)

Licensed under the MIT license: http://opensource.org/licenses/MIT

Basic usage

0 - Install the package:

composer require alikhalili/simple-captcha

1- Create a captcha object:

$captcha = new Captcha();

2- Draw image

$captcha->config();
$image = $capthca->getImage();

//in the view
echo "<img src='$image' />";

//or in ajax response to a refresh request:
echo $image;

or validate the code:

$captchaIsValid = $captcha->verify($givenCode);

Thanks

About

A simple PHP CAPTCHA script.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%