phphleb/ucaptcha

Universal captcha

dev-main 2024-01-29 15:02 UTC

This package is auto-updated.

Last update: 2024-04-29 15:36:17 UTC


README

PHP License: MIT

CAPTCHA EXAMPLE

CAPTCHA EXAMPLE

CAPTCHA EXAMPLE

Universal Captcha

Install using Composer:

$ composer require phphleb/ucaptcha

Шаг первый. Создание изображения (отображает PNG).

Step one. Image creation (displays PNG).

(new \Phphleb\Ucaptcha\Captcha())->createImage(\Phphleb\Ucaptcha\Captcha::TYPE_BASE);

Шаг второй. Проверка кода, введённого пользователем.

Step two. Checking the code entered by the user.

if ((new \Phphleb\Ucaptcha\Captcha())->check($code)) {
 // Characters entered correctly.
} else {
 // Invalid characters.
};

Проверка успешного прохождения капчи за текущую пользовательскую сессию.

Checking the successful completion of the captcha for the current user session.

if ((new \Phphleb\Ucaptcha\Captcha())->isPassed()) {
 // The captcha has already been completed earlier.
}