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

Overview

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
    }
});
You might also like...
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

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

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

🐋📦✂️📋📦 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

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

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

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

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

Detect the position of a face in an image.

Face Detector PHP GD 를 이용해 이미지의 얼굴 위치를 식별합니다. mauricesvay/php-facedetection 프로젝트를 기반으로 만들었습니다. js 로 포팅하며 개선한 사항들을 적용하여 error_reporting = E_ALL safe 하게

Releases(2.5.0)
Owner
Nikos M.
Code Artist, Software / Machine Learning Architect, Musician.
Nikos M.
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

Leon Djusberg 0 Aug 30, 2022
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

Hi Folks! 289 Dec 27, 2022
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

Hi Folks! 290 Dec 29, 2022
WordPress plugin renames image filenames to be more SEO friendly, based on the post's data and image metadata.

=== Automatic image Rename === Contributors: wpsunshine Tags: image, images, SEO, rename, optimization Requires at least: 5.0 Tested up to: 6.2.2 Stab

null 8 Jun 11, 2023
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']

Филип Арсовски 11 Oct 10, 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

WILLIAM B. SAMPAIO 3 Nov 9, 2022
Implement a "Where's Wally" (or Waldo/Charlie) Captcha in a simple Symfony Project

Where's Wally ? Nowadays, we are often confronted with "Captcha". These tests to know if we are robots or not. They are all very boring and not very f

rherault 3 Oct 7, 2022
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

guanguans 29 Dec 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

null 10 Dec 14, 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_

Webfacing 2 Jul 26, 2022