1. Go to this page and download the library: Download cleantalk/php-antispam 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/ */
cleantalk / php-antispam example snippets
composer
linenums="1"
$apikey = ''; // get it here cleantalk.org (free trial)
$email_field = $_POST['email']; // get it from your form
$cleantalk_antispam = new CleantalkAntispam($apikey, $email_field);
// Additional parameters here
$api_result = $cleantalk_antispam->handle();
linenums="3"
...
// Additional parameters here
$cleantalk_antispam->setEventTokenEnabled(1);
...
if ($api_result && $api_result->allow === 0) {
die('Blocked. Spam protection OK. Reason: ' . $api_result->comment);
// or make your own actions/logs/messages ...
}
// TROUBLESHOOTING: logging the suggestions
error_log($cleantalk_antispam->whatsWrong(true));
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.