diff --git a/README.md b/README.md index 1d55a2d..6dc2a86 100644 --- a/README.md +++ b/README.md @@ -21,186 +21,51 @@ API sends a comment's text and several previous approved comments to the servers * PHP 5.6 and above * CURL support +You can unpack the archive with the plugin to the root of the site or install it using the composer -## Sample SPAM test for user signup +```php +composer require cleantalk/php-antispam +``` + +### Sample SPAM test for text comment and user signup ```php auth_key = $auth_key; - $ct_request->agent = 'php-api'; - $ct_request->sender_email = $sender_email; - $ct_request->sender_ip = $sender_ip; - $ct_request->sender_nickname = $sender_nickname; - $ct_request->js_on = $js_on; - $ct_request->submit_time = time() - (int) $_SESSION['ct_submit_time']; - - $ct = new Cleantalk(); - $ct->server_url = $config_url; - - // Check - $ct_result = $ct->isAllowUser($ct_request); - - if ($ct_result->allow == 1) { - echo 'User allowed. Reason ' . $ct_result->comment; - } else { - echo 'User forbidden. Reason ' . $ct_result->comment; - } - echo '

'; -} -else -{ - $_SESSION['ct_submit_time'] = time(); -} -?> +$apikey = 'your_cleantalk_api_key'; +$email_field = 'name_email_form_field'; +$user_name_field = 'name_user_name_form_field'; +$message_field = 'name_message_form_field'; +$type_form = 'contact'; // use 'signup' for user signup form -
-