1. Go to this page and download the library: Download miguilim/antibotlinks library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
miguilim / antibotlinks example snippets
Use Miguilim\AntiBotLinks\AntiBotLinks;
use Miguilim\AntiBotLinks\CacheAdapters\SimpleFileCacheAdapter;
$antibotlinks = AntiBotLinks::make('1', new SimpleFileCacheAdapter(__DIR__ . '/cache'));
var_dump($antibotlinks->generateLinks());
use Miguilim\AntiBotLinks\CacheAdapters\AbstractCacheAdapter;
class MyCustomCacheAdapter extends AbstractCacheAdapter
{
public function remember(string $key, int $expiresIn, callable $callback): mixed
{
//
}
public function get(string $key): mixed
{
//
}
public function forget(string $key): bool
{
//
}
}
$links = $antibotlinks->generateLinks(amount: 3);
$antibotlinks->validateAnswer($answer);
$antibotlinks->flushLinks();
// Enable or Disable image noise (Default: true)
$antibotlinks->noise(value: false);
// Enable or Disable image background (Default: false)
$antibotlinks->background(value: true);
// Enable or Disable dark theme (Default: false)
$antibotlinks->darkTheme(value: true);