arcaptcha
v1.0.2 : fix bug
Bibliothèque PHP pour arcaptcha . Ce package prend en charge PHP 7.3+
.
Exiger ce package avec composer :
composer require mohammadv184/ arcaptcha
Vous pouvez créer une nouvelle instance en transmettant SiteKey et SecretKey depuis votre API. Vous pouvez l'obtenir sur https://arcaptcha.ir/dashboard
use Mohammadv184 arcaptcha arcaptcha ;
$ arcaptcha = new arcaptcha ( $ siteKey , $ secretKey );
Comment utiliser arcaptcha .
Pour afficher l' arcaptcha sur un formulaire, utilisez la classe pour restituer la balise de script et le widget.
<?php echo $ arcaptcha -> getScript () ?>
<form method="POST">
<?php echo $ arcaptcha -> getWidget () ?>
<input type="submit" value="Submit" />
</form>
Après la publication, utilisez la classe pour vérifier la réponse. Vous obtenez vrai ou faux :
if ( $ arcaptcha -> verify ( $ _POST [ " arcaptcha -token " ])) {
echo " OK! " ;
} else {
echo " FAILED! " ;
}
La licence MIT (MIT). Veuillez consulter le fichier de licence pour plus d'informations.