PHP Classes
elePHPant
Icontem

OneClickCaptcha: CAPTCHA validation based on user clicks on circles

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (17)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2016-03-22 (5 months ago) RSS 2.0 feedStarStarStar 58%Total: 726 All time: 4,368 This week: 888Up
Version License PHP version Categories
one-click-captcha 1.4GNU General Publi...5.3PHP 5, Graphics, Web services, Valida..., S...
Description Author

This class can perform CAPTCHA validation based on user clicks on circles.

It render an image with several circles on random positions. Only one circle appears cut.

The class performs CAPTCHA validation by checking the position where the user clicks on the image to verify it it is inside of the circle that is cut.

The generated image is served in PNG format. The values of the rendered circles are stored in session variables for subsequent validation.

The size and colors of the image and the circles are configurable parameters.

Picture of Kacper Rowinski
  Performance   Level  
Name: Kacper Rowinski <contact>
Classes: 7 packages by
Country: Poland Poland
Age: 32
All time rank: 125933 in Poland Poland
Week rank: 49 Up1 in Poland Poland Up
Innovation award
Innovation award
Nominee: 3x

Details

OneClick captcha

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

This lib can perform CAPTCHA validation based on user clicks on circles.

It render an image with several circles on random positions. Only one circle appears cut.

The class performs CAPTCHA validation by checking the position where the user clicks on the image to verify it it is inside of the circle that is cut.

The generated image is served in PNG format. The values of the rendered circles are stored in session variables for subsequent validation.

The size and colors of the image and the circles are configurable parameters.

1. install using composer
composer require krowinski/one-click-captcha
2. example


include __DIR__ . '/../vendor/autoload.php';
error_reporting(E_ALL);
$OneClickCaptchaServiceFactory = new \OneClickCaptcha\Service\OneClickCaptchaServiceFactory();
$oneClickCaptcha = $OneClickCaptchaServiceFactory->getOneClickCaptcha();
// simple demonstration!
$request = isset($_GET['get_captcha']) ? $_GET['get_captcha'] : '';
if ($request === 'true') {
    $oneClickCaptcha->showCaptcha();
} else {
    if (isset($_REQUEST['position'][0], $_REQUEST['position'][1])) {
        if (true === $oneClickCaptcha->validate($_REQUEST['position'][0], $_REQUEST['position'][1])) {
            echo '<h3>You are human!!</h3>';
        } else {
            echo '<h3>Wrong!</h3>';
        }
    }
}
// this is all html you need to validate captcha
echo '
<form action="example.php" method="POST">
	<input type="image" src="example.php?get_captcha=true" name="position[]"/>
</form>
';

Screenshots  
  • occ.png
  Files folder image Files  
File Role Description
Files folder imageexample (1 file)
Files folder imagesrc (4 directories)
Files folder imagetests (4 directories)
Accessible without login Plain text file .gitignore Data Auxiliary data
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file example.php Example Example script

  Files folder image Files  /  src  
File Role Description
Files folder imageConfig (1 file)
Files folder imageProxy (1 file)
Files folder imageRepository (2 files)
Files folder imageService (2 files)

  Files folder image Files  /  src  /  Config  
File Role Description
  Accessible without login Plain text file Config.php Conf. Configuration script

  Files folder image Files  /  src  /  Proxy  
File Role Description
  Plain text file ImagineProxy.php Class Class source

  Files folder image Files  /  src  /  Repository  
File Role Description
  Plain text file Post.php Class Class source
  Plain text file SessionPostRepository.php Class Class source

  Files folder image Files  /  src  /  Service  
File Role Description
  Plain text file OneClickCaptchaService.php Class Class source
  Plain text file OneClickCaptchaServiceFactory.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imageConfig (1 file)
Files folder imageProxy (1 file)
Files folder imageRepository (1 file)
Files folder imageService (1 file)

  Files folder image Files  /  tests  /  Config  
File Role Description
  Accessible without login Plain text file ConfigTest.php Test Unit test script

  Files folder image Files  /  tests  /  Proxy  
File Role Description
  Accessible without login Plain text file ImagineProxyTest.php Test Unit test script

  Files folder image Files  /  tests  /  Repository  
File Role Description
  Accessible without login Plain text file SessionPostRepositoryTest.php Test Unit test script

  Files folder image Files  /  tests  /  Service  
File Role Description
  Accessible without login Plain text file OneClickCaptchaServiceTest.php Test Unit test script

 Version Control Unique User Downloads Download Rankings  
 94%
Total:726
This week:0
All time:4,368
This week:888Up
User Ratings User Comments (1)
 All time
Utility:83%StarStarStarStarStar
Consistency:83%StarStarStarStarStar
Documentation:-
Examples:83%StarStarStarStarStar
Tests:-
Videos:-
Overall:58%StarStarStar
Rank:1232
 
Great idea.
3 years ago (Eduardo souza)
70%StarStarStarStar