rcdosado / simplecaptcha

demo of using a very simple captcha, generated by php libraries, no external dependencies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simpleng Php Captcha

Dead simple way to create captcha for your site

This project provides a demo of generating and using a simple Captcha. generate captcha w/o external dependencies, plain simple PHP

Installation

simply copy paste captcha.php, see the demo.

Usage example

// see the example index.php on how to integrate this to your site
<?php
include_once('./captcha.php');

// Start the session
session_start();

$captcha2 = new Captcha();
$_SESSION['captcha2'] = $captcha2->generateAlphaNumericChallenge();

$captcha2->generateImage();
?>

Running the demo

  1. clone this repo. go to the cloned directory
  2. type php -S localhost:8000 in your terminal
  3. open your browser, go to localhost:8000

Development setup

testing this requires phpunit. just run composer update

composer update

Release History

  • 0.2.1
    • CHANGE: Update docs (module code remains unchanged)
  • 0.2.0
    • ADD: Add generateAlphaNumericChallenge() to generate alphanumeric random values
  • 0.1.1
    • FIX: invalid width for generated 5 digit random value
  • 0.1.0
    • The first proper release
    • CHANGE: created CaptchaTest.php to test the functionalities using phpunit.
  • 0.0.1
    • Work in progress

Meta

Roy Cyril Dosado – @keyboardcaperrcdosado@gmail.com

Distributed under the XYZ license. See LICENSE for more information.

https://github.com/rcdosado/simplecaptcha

About

demo of using a very simple captcha, generated by php libraries, no external dependencies


Languages

Language:PHP 100.0%