kenjis/ci3-like-captcha

CodeIgniter3-like Captcha

v1.1.1 2022-10-05 07:21 UTC

This package is auto-updated.

Last update: 2024-05-05 12:03:48 UTC


README

This project provides CodeIgniter3-like Captcha.

Requirements

  • PHP 7.4 or later

Installation

$ composer require kenjis/ci3-like-captcha

Usage

See https://codeigniter.com/userguide3/helpers/captcha_helper.html.

Instead of create_captcha(), use Captcha::createCaptcha().

use Kenjis\CI3Like\Captcha\Captcha;

$vals = [
    'word'      => random_string('numeric', 4),
    'img_path'  => FCPATH . 'captcha/',
    'img_url'   => base_url() . '/captcha/',
];
$cap = Captcha::createCaptcha($vals);

$data = [
    'captcha_id'   => '',
    'captcha_time' => $cap['time'],
    'word'         => $cap['word'],
];

License

This package is licensed using the MIT License.

Please have a look at LICENSE.