Simple, image-based, mathematical captcha, with increasing levels of difficulty

Last update: Aug 7, 2022

simple-captcha

Simple, image-based, mathematical captcha, with increasing levels of difficulty

version 1.1.0

SimpleCaptcha

see also:

  • ModelView a simple, fast, powerful and flexible MVVM framework for JavaScript
  • tico a tiny, super-simple MVC framework for PHP
  • LoginManager a simple, barebones agnostic login manager for PHP, JavaScript, Python
  • SimpleCaptcha a simple, image-based, mathematical captcha with increasing levels of difficulty for PHP, JavaScript, Python
  • Dromeo a flexible, and powerful agnostic router for PHP, JavaScript, Python
  • PublishSubscribe a simple and flexible publish-subscribe pattern implementation for PHP, JavaScript, Python
  • Importer simple class & dependency manager and loader for PHP, JavaScript, Python
  • Contemplate a fast and versatile isomorphic template engine for PHP, JavaScript, Python
  • HtmlWidget html widgets, made as simple as possible, both client and server, both desktop and mobile, can be used as (template) plugins and/or standalone for PHP, JavaScript, Python (can be used as plugins for Contemplate)
  • Paginator simple and flexible pagination controls generator for PHP, JavaScript, Python
  • Formal a simple and versatile (Form) Data validation framework based on Rules for PHP, JavaScript, Python
  • Dialect a cross-vendor & cross-platform SQL Query Builder, based on GrammarTemplate, for PHP, JavaScript, Python
  • DialectORM an Object-Relational-Mapper (ORM) and Object-Document-Mapper (ODM), based on Dialect, for PHP, JavaScript, Python
  • Unicache a simple and flexible agnostic caching framework, supporting various platforms, for PHP, JavaScript, Python
  • Xpresion a simple and flexible eXpression parser engine (with custom functions and variables support), based on GrammarTemplate, for PHP, JavaScript, Python
  • Regex Analyzer/Composer Regular Expression Analyzer and Composer for PHP, JavaScript, Python

Example:

// setup
$captcha = (new SimpleCaptcha())
    ->option('secret_key', 'SECRET_KEY')
    ->option('secret_salt', 'SECRET_SALT_')
    ->option('difficulty', 1) // 1 (easy) to 3 (difficult)
    ->option('num_terms', 2)
    ->option('min_term', 1)
    ->option('max_term', 21)
    ->option('color', 0x121212) // text color
    ->option('color2', 0x717171) // secondary text color
    ->option('background', 0xffffff) // background color
    ->reset()
;
<!-- use it -->

<form action="/validate" method="post">
<!-- you can store the captcha hash in the $_SESSION or in $_COOKIE as well -->
<input type="hidden" name="hash" value="<?php echo $captcha->getHash(); ?>" />
Compute result <img src="<?php echo $captcha->getCaptcha(); ?>" /> <input type="text" name="answer" value="" />
<button type="submit">Submit</button>
</form>
// use it
$app->on('/validate', function() use ($captcha) {
    // you can store the captcha hash in the $_SESSION or in $_COOKIE as well
    if ($captcha->validate($_POST['answer'], $_POST['hash']))
    {
    // correct captcha
    }
    else
    {
    // wrong captcha
    }
});

GitHub

https://github.com/foo123/simple-captcha
You might also like...

CloudFlare Image Resizing plugin for WordPress.

Cloudflare Image Resizing plugin for WordPress The current Cloudflare plugin for WordPress does not replace URL's automatically for you to use the Ima

Aug 8, 2022

๐Ÿ‹๐Ÿ“ฆโœ‚๏ธ๐Ÿ“‹๐Ÿ“ฆ Docker image of packagist mirror

Docker for Packagist Mirror This project allows you to easily create and update a mirror of the packagist having as dependency only the docker. It is

Jan 20, 2022

Docker image that provides static analysis tools for PHP

Static Analysis Tools for PHP Docker image providing static analysis tools for PHP. The list of available tools and the installer are actually managed

Aug 3, 2022

Smd thumbnail - Multiple image thumbnails of arbitrary dimensions

smd_thumbnail Download | Packagist If youโ€™re bored of one Textpattern thumbnail per image and donโ€™t fancy using an auto-resizing script or relying on

Dec 9, 2021

Tom image grid - Plugin for Textpattern CMS : An optionnal grid display for images tab

tom_image_grid tom_image_grid is a plugin for Textpattern CMS. It allows a more compact display (as a grid) of the images list. The plugin adds two bu

Jun 30, 2019

Docker-magento - Docker image for Magento 1.6 to 1.9

Docker image for Magento 1.x This repo creates a Docker image for Magento 1.x. Please note The primary goal of this repo is to create Docker images fo

Dec 17, 2021

Detect the position of a face in an image.

Face Detector PHP GD ๋ฅผ ์ด์šฉํ•ด ์ด๋ฏธ์ง€์˜ ์–ผ๊ตด ์œ„์น˜๋ฅผ ์‹๋ณ„ํ•ฉ๋‹ˆ๋‹ค. mauricesvay/php-facedetection ํ”„๋กœ์ ํŠธ๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. js ๋กœ ํฌํŒ…ํ•˜๋ฉฐ ๊ฐœ์„ ํ•œ ์‚ฌํ•ญ๋“ค์„ ์ ์šฉํ•˜์—ฌ error_reporting = E_ALL safe ํ•˜๊ฒŒ

Jul 27, 2022

A text-based, persistent browser-based strategy game (PBBG) in a fantasy war setting

A text-based, persistent browser-based strategy game (PBBG) in a fantasy war setting

Note: OpenDominion is still in development. Some features of the game have not been implemented yet. Introduction OpenDominion is a free and open-sour

Jul 29, 2022

Currency is a simple PHP library for current and historical currency exchange rates & crypto exchange rates. based on the free API exchangerate.host

Currency Currency is a simple PHP library for current and historical currency exchange rates & crypto exchange rates. based on the free API exchangera

Jul 4, 2022
a hub for American soccer clubs of all levels, built with Laravel and Vue 3

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Jan 18, 2022
PHP package that provides functions for calculating mathematical statistics of numeric data
PHP package that provides functions for calculating mathematical statistics of numeric data

Statistics PHP package PHP package that provides functions for calculating mathematical statistics of numeric data. In this package I'm collecting som

Aug 9, 2022
PHP package that provides functions for calculating mathematical statistics of numeric data.
PHP package that provides functions for calculating mathematical statistics of numeric data.

Statistics PHP package PHP package that provides functions for calculating mathematical statistics of numeric data. In this package I'm collecting som

Aug 9, 2022
Simple customizable captcha script for bot prevention in php language.

phpCaptcha Simple customizable captcha script for bot prevention in php language. Usage <?php session_start(); $status = ""; if ($_SESSION['captcha']

Apr 7, 2022
Simple class that implement a CAPTCHA for your PHP App.

simple-captcha Simple class that implement a CAPTCHA for your PHP App. Installation Use the package manager composer to install. composer require will

Feb 15, 2022
dcat admin login captcha. - dcat admin ็™ปๅฝ•้ชŒ่ฏ็ ใ€‚
dcat admin login captcha. - dcat admin ็™ปๅฝ•้ชŒ่ฏ็ ใ€‚

dcat-login-captcha ็ฎ€ไฝ“ไธญๆ–‡ | ENGLISH dact admin login captcha. - dcat admin ็™ปๅฝ•้ชŒ่ฏ็ ใ€‚ ็Žฏๅขƒ่ฆๆฑ‚ dcat-admin >= 2.0 ๅฎ‰่ฃ… Composer ๅฎ‰่ฃ… $ composer require guanguans/dca

Jul 5, 2022
Friendly Captcha anti-spam plugin for Joomla!

Friendly Captcha anti-spam plugin for Joomla! Register at https://friendlycaptcha.com to get your site and secret keys. Plugin Features Standard light

Jul 24, 2022
WPBruiser {no- Captcha anti-Spam} (forked, updated)

=== WPBruiser {no- Captcha anti-Spam} === Contributors: mihche, knutsp Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_

Jul 26, 2022
It's a CodeIgniter Library for Captcha Generation. With additional Flexibility .

Original Source : Pavel Tzonkov <[email protected]> Source Link : http://gscripts.net/free-php-scripts/Anti_Spam_Scripts/Image_Validator/d

Jun 23, 2022
Magento 2 Module to add simple image resizing capabilities in all blocks and .phtml templates
Magento 2 Module to add simple image resizing capabilities in all blocks and .phtml templates

Magento 2 Image Resizer Magento 2 Module to add simple image resizing capabilities in all blocks and .phtml templates Installation $ composer require

Apr 18, 2022