arcaptcha
v1.0.2 : fix bug
arcaptcha的 PHP 库。该软件包支持PHP 7.3+ 。
需要此包与作曲家:
composer require mohammadv184/ arcaptcha 您可以通过从 API 传递 SiteKey 和 SecretKey 来创建新实例。您可以在 https://arcaptcha.ir/dashboard 获取该信息
use Mohammadv184 arcaptcha arcaptcha ;
$ arcaptcha = new arcaptcha ( $ siteKey , $ secretKey );如何使用arcaptcha 。
要在表单上显示arcaptcha ,请使用该类来呈现脚本标记和小部件。
<?php echo $ arcaptcha -> getScript () ?>
<form method="POST">
<?php echo $ arcaptcha -> getWidget () ?>
<input type="submit" value="Submit" />
</form>发布后,使用类来验证响应。你会得到 true 或 false 回复:
if ( $ arcaptcha -> verify ( $ _POST [ " arcaptcha -token " ])) {
echo " OK! " ;
} else {
echo " FAILED! " ;
}麻省理工学院许可证 (MIT)。请参阅许可证文件以获取更多信息。