Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eusonlito/captcha
A new simple and easy-to-implement captcha package.
https://github.com/eusonlito/captcha
captcha php
Last synced: about 1 month ago
JSON representation
A new simple and easy-to-implement captcha package.
- Host: GitHub
- URL: https://github.com/eusonlito/captcha
- Owner: eusonlito
- License: mit
- Created: 2015-09-11T17:34:36.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2022-07-23T13:25:05.000Z (over 2 years ago)
- Last Synced: 2024-09-14T15:06:34.804Z (2 months ago)
- Topics: captcha, php
- Language: PHP
- Homepage:
- Size: 364 KB
- Stars: 7
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Easy Captcha :)
[![Build Status](https://travis-ci.org/eusonlito/captcha.svg?branch=master)](https://travis-ci.org/eusonlito/captcha)
[![Latest Stable Version](https://poser.pugx.org/eusonlito/captcha/v/stable.png)](https://packagist.org/packages/eusonlito/captcha)
[![Total Downloads](https://poser.pugx.org/eusonlito/captcha/downloads.png)](https://packagist.org/packages/eusonlito/captcha)
[![License](https://poser.pugx.org/eusonlito/captcha/license.png)](https://packagist.org/packages/eusonlito/captcha)A new simple and easy-to-implement captcha package.
## Installation with Composer
```json
{
"require": {
"eusonlito/captcha": "1.0.*"
}
}
```## Demos
![Default Captcha](https://eusonlito.github.io/captcha/assets/images/multiple-fonts.png)
![Only one font](https://eusonlito.github.io/captcha/assets/images/one-font.png)
![Large Captcha](https://eusonlito.github.io/captcha/assets/images/large.png)
![Short Captcha](https://eusonlito.github.io/captcha/assets/images/short.png)
![With Background](https://eusonlito.github.io/captcha/assets/images/background.png)
![Custom Letters](https://eusonlito.github.io/captcha/assets/images/letters.png)
![With Noise](https://eusonlito.github.io/captcha/assets/images/noise.png)
![Only Noise Points](https://eusonlito.github.io/captcha/assets/images/noise-points.png)
![Only Noise Lines](https://eusonlito.github.io/captcha/assets/images/noise-lines.png)## Usage
### Template
```php
... or ...
= Captcha::img($LETTERS_COUNT, $WIDTH, $HEIGHT); ?>
... or ...
= Captcha::img($LETTERS_COUNT, $WIDTH, $HEIGHT, array('class' => 'img-responsive')); ?>
... or ...
= Captcha::img($LETTERS_COUNT, $WIDTH, $HEIGHT); ?>
= Captcha::input(array('class' => 'form-control')); ?>... or ...
= Captcha::img(array($LETTERS_MIN, $LETTERS_MAX), $WIDTH, $HEIGHT); ?>
= Captcha::input(array('class' => 'form-control')); ?>
```If you are using an environment without sessions, you must add `Captcha::sessionStart()` before any html output (Controller).
### Checking
```php
[
...'Captcha' => 'Eusonlito\Captcha\Captcha',
...
]
];
```Now you will have a `Captcha` class available on your controllers and views.
## Print Options
```php
'img-responsive')); # Print img tag with class attribute# Simple input tag print
Captcha::input(); # Print input tag# Input tag with parameters
Captcha::input(array('class' => 'form-control')); # Print input tag with class attribute
```## Custom Setup
All custom settings will be defined before `img`, `source` or `check` methods calls.
```php