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)。請參閱許可證文件以獲取更多資訊。