Skip to content

Captcha

Keramat Jokar edited this page May 13, 2024 · 2 revisions

How to use

<?php

require_once('application/libraries/Captcha.php');

$captcha = new Captcha();

$captcha->generate();
$captcha->output(70, 25);
if($captcha_value == $captcha->getValue())
{
// Correct captcha
}

__construct([$enable])

Initialize the current session if available

(Optional) $enable

generate()

Generate a new value and tie it to a session

output($width, $height)

Create an image

Int $width

Int $height

[String] getValue()

Get the captcha value as plaintext and destroy the session

Clone this wiki locally