PHP code example of unetway / recaptcha

1. Go to this page and download the library: Download unetway/recaptcha 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/ */

    

unetway / recaptcha example snippets


use Unetway\Recaptcha;

$secretKey = 'Ваш секретный ключ рекапчи';
$response = 'Значение response';
$ip = $_SERVER['HTTP_CLIENT_IP'];

$recaptcha = new Recaptcha($secretKey);
if ($recaptcha->siteVerify($response, $ip)) {
 echo 'Вы человек :)';
} else {
 echo 'Вы бот!';
}