arcaptcha/arcaptcha-php
最新稳定版本:1.0.8
Composer 安装命令:
composer require arcaptcha/arcaptcha-php
包简介
PHP library for ArCaptcha
关键字:
README 文档
README
PHP library for ArCaptcha.
This package supports PHP 7.3+.
List of contents
Installation
Require this package with composer:
composer require arcaptcha/arcaptcha-php
Configuration
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 Mohammadv184\ArCaptcha\ArCaptcha; $ArCaptcha = new ArCaptcha($siteKey, $secretKey); // To set options like color,lang,... $ArCaptcha = new ArCaptcha($siteKey, $secretKey,['lang'=>'en','theme'=>'dark']);
To see available options on widget see here
How to use
How to use ArCaptcha.
Widget usage
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>
Note: You can pass available widget options like color,lang,... into getWidget function
Verifying a response
After the post, use the class to verify the response. You get true or false back:
if ($ArCaptcha->verify($_POST["arcaptcha-response"])) { echo "OK!"; } else { echo "FAILED!"; }
Invisible mode
To see how invisible mode is working in this library see this example
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 3.18k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 1
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-01-25