PHPackages                             cleantalk/php-checkbot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. cleantalk/php-checkbot

ActiveLibrary[Security](/categories/security)

cleantalk/php-checkbot
======================

The best app to filter bots during the simple page viewing

1.0.0(yesterday)51↑2900%3GPL-3.0-or-laterPHP

Since Mar 23Pushed yesterday2 watchersCompare

[ Source](https://github.com/CleanTalk/php-checkbot)[ Packagist](https://packagist.org/packages/cleantalk/php-checkbot)[ RSS](/packages/cleantalk-php-checkbot/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

This guideline will help you to use CleanTalk check\_bot API method via the special library that can be downloaded from this repo.

Usage
-----

[](#usage)

1. Install the package via composer

`composer install cleantalk/php-checkbot`

2. Include the composer autoloader into your app

`require_once 'vendor/autoloader.php';`

3. Add the CleanTalk Bot-detector JS library wrapper `https://fd.cleantalk.org/ct-bot-detector-wrapper.js` as ``tag to the HTML page contains the form you want to protect.

```

```

4. Prepare config and create a new CleanTalk\\CheckBot object, provide $\_POST or filtered POST data to the constructor.

```
$check_bot_config = array(
    'access_key' => "YOUR-CLEANTALK-API-KEY"
);
$config = new \Cleantalk\CheckBot\CheckBotConfig($check_bot_config);
$bot_checker = new \Cleantalk\CheckBot\CheckBot($config, $_POST);
```

5. Then perform the check:

```
$is_bot = $bot_checker->check()->getVerdict();
```

6. Then do the actions depending on the verdict.

```
if ( $is_bot ) {
  die ($bot_checker->getBlockMessage());
}
```

7. How it looks in the suggested files structure:

- `index.html`:

```
>

   Title

      What do you search?

```

- `your_form_handler.php`:

```
