2017 © Pedro Peláez
 

library captcha

simple Captcha maker.

image

ackintosh/captcha

simple Captcha maker.

  • Sunday, July 21, 2013
  • by ackintosh
  • Repository
  • 1 Watchers
  • 1 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Captcha for php

This is Captcha library for php., (*1)

sample captcha, (*2)

Installation

composer.json, (*3)

{
    "require": {
        "ackintosh/captcha": "dev-master"
    }
}
$ php composer.phar install

Usage

Output a default Captcha image

<?php
require_once 'vendor/autoload.php';
use Ackintosh\Captcha;
use Ackintosh\CaptchaConfig;

$cap = new Captcha(CaptchaConfig::instance());
$cap->output();

With settings

We can override setting., (*4)

<?php
$config = array(
    'type'         => 'jpeg',
    'width'        => 200,
    'height'       => 100,
    'seeds'        => 'ABCDEFG1234567',
    'stringLength' =>10,
);
$cap = new Captcha(CaptchaConfig::instance($config));
$cap->output();

Validate

<?php
require_once 'vendor/autoload.php';

if (Ackintosh\Captcha::isValidCode($_POST['code']))
    echo 'ok';
else
    echo 'ng';

Requirements

  • PHP 5.3 or greater
  • GD
  • FreeType

Thanks

The Versions

21/07 2013

dev-master

9999999-dev

simple Captcha maker.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

captcha