https://github.com/mohammadv184/arcaptcha
PHP library for ArCaptcha
https://github.com/mohammadv184/arcaptcha
arcaptcha captcha persian-captcha php php-captcha php-library
Last synced: 29 days ago
JSON representation
PHP library for ArCaptcha
- Host: GitHub
- URL: https://github.com/mohammadv184/arcaptcha
- Owner: mohammadv184
- License: mit
- Created: 2021-08-03T20:07:39.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-04-19T19:46:17.000Z (about 2 years ago)
- Last Synced: 2025-03-27T02:08:03.728Z (about 2 months ago)
- Topics: arcaptcha, captcha, persian-captcha, php, php-captcha, php-library
- Language: PHP
- Homepage: https://arcaptcha.ir
- Size: 89.8 KB
- Stars: 10
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP ArCaptcha Library
[](https://packagist.org/packages/mohammadv184/arcaptcha)
[](https://packagist.org/packages/mohammadv184/arcaptcha)
[](https://packagist.org/packages/mohammadv184/arcaptcha)
[](https://travis-ci.com/mohammadv184/arcaptcha)
[](https://packagist.org/packages/mohammadv184/arcaptcha)PHP library for ArCaptcha.
This package supports `PHP 7.3+`.# List of contents
- [PHP ArCaptcha Library](#PHP-ArCaptcha-Library)
- [List of contents](#list-of-contents)
- [Installation](#Installation)
- [Configuration](#Configuration)
- [How to use](#how-to-use)
- [Widget usage](#Widget-usage)
- [Verifying a response](#Verifying-a-response)
- [Credits](#credits)
- [License](#license)## Installation
Require this package with composer:
```bash
composer require mohammadv184/arcaptcha
```## 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```php
use Mohammadv184\ArCaptcha\ArCaptcha;$ArCaptcha = new ArCaptcha($siteKey, $secretKey);
```
## How to useHow to use ArCaptcha.
### Widget usage
To show the ArCaptcha on a form, use the class to render the script tag and the widget.
```php
getScript() ?>getWidget() ?>
```
### Verifying a response
After the post, use the class to verify the response.
You get true or false back:
```php
if ($ArCaptcha->verify($_POST["arcaptcha-token"])) {
echo "OK!";
} else {
echo "FAILED!";
}
```
## Credits- [Mohammad Abbasi](https://github.com/mohammadv184)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.