arcaptcha
v1.0.2 : fix bug
PHP library for arcaptcha.
This package supports PHP 7.3+
.
Require this package with composer:
composer require mohammadv184/arcaptcha
You can create a new instance by passing the SiteKey and SecretKey from your API. You can get that at https://arcaptcha.ir/dashboard
use Mohammadv184arcaptchaarcaptcha;
$arcaptcha = new arcaptcha($siteKey, $secretKey);
How to use arcaptcha.
To show the arcaptcha on a form, use the class to render the script tag and the widget.
<?php echo $arcaptcha->getScript() ?>
<form method="POST">
<?php echo $arcaptcha->getWidget() ?>
<input type="submit" value="Submit" />
</form>
After the post, use the class to verify the response. You get true or false back:
if ($arcaptcha->verify($_POST["arcaptcha-token"])) {
echo "OK!";
} else {
echo "FAILED!";
}
The MIT License (MIT). Please see License File for more information.