Skip to content

johansatge/simple-captcha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Captcha

A dead simple PHP captcha.


Disclaimer

This captcha should be considered as a proof of concept, and a simple demo of image generation in PHP.

It should not be used on production environments, as it can be easily defeated by captcha solvers or OCR softwares.

Installation

Usage

Call the script in a <img> tag in a form:

<img src="/path/to/captcha.php?rand=<?php echo md5(microtime(true)); ?>">

The image goes with an <input>:

<input type="text" name="captcha_value">

On form submit, check the entered value:

if (!empty($_SESSION['simple_captcha']) && !empty($_POST['captcha_value']) && $_SESSION['simple_captcha'] == $_POST['captcha_value'])
{
  // The captcha is valid
}

Changelog

Version Date Notes
1.0.0 August 29, 2015 Initial version

License

This project is released under the MIT License.

Credits

About

A dead simple PHP captcha.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published