wobeto/google-recaptcha-checkbox
Composer 安装命令:
composer require wobeto/google-recaptcha-checkbox
包简介
Service to validate Google recaptcha checkbox
README 文档
README
To install via composer, run:
composer require wobeto/google-recaptcha-checkbox
Register a new site on https://www.google.com/recaptcha/admin
Include the follow script to your site
<script src="https://www.google.com/recaptcha/api.js?hl=pt-BR"></script>
Include the google div recaptcha inside form tag and the site key in the data-sitekey attribute
<div class="g-recaptcha" data-sitekey="site-key"></div>
PHP server use:
<?php include 'vendor/autoload.php'; use Wobeto\GoogleRecaptchaCheckbox\Recaptcha; try { $secret = '4Lchd-IvAAeAAIWBvzYvAEKu1chTimd0HJroP9T4'; $recaptcha = new Recaptcha($secret); $verify = $recaptcha->verify($_POST['g-recaptcha-response']); var_dump($verify); //true } catch (Exception $e) { echo $e->getMessage(); }
Enjoy...
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-05-22