PHP code example of iktbd / captcha-image
1. Go to this page and download the library: Download iktbd/captcha-image library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
iktbd / captcha-image example snippets
use Iktbd\CaptchaImage\Captcha;
//Set your password as your wish
$password='djhfhdfywh53477';
//Create new captcha
$src_string=Captcha::create($password);
use Iktbd\CaptchaImage\Captcha;
//Set your same password
$password='djhfhdfywh53477';
//Get the input value from the form submit
$text=$_POST['captcha_text'];
//Check submitted captcha data
$result=Captcha::verify($password,$text);
if($result==true)
{
echo 'Captcha is correct';
}
else
{
echo 'Captcha is wrong';
}
json
"iktbd/captcha-image": "^2.00"