PHP code example of paragonie / recaptcha

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

    

paragonie / recaptcha example snippets


$curl = new ReCaptcha\RequestMethod\CurlPost(null, array(
    CURLOPT_PROXY => 'http://127.0.0.1:9050/',
    CURLOPT_PROXYTYPE => CURLPROXY_SOCKS5
));
$recaptcha = new \ReCaptcha\ReCaptcha($secret, $curl);
$resp = $recaptcha->verify($gRecaptchaResponse, $remoteIp);
if ($resp->isSuccess()) {
    // verified!
} else {
    $errors = $resp->getErrorCodes();
}


$recaptcha = new \ReCaptcha\ReCaptcha($secret);


$recaptcha = new \ReCaptcha\ReCaptcha($secret);
$resp = $recaptcha->verify($gRecaptchaResponse, $remoteIp);
if ($resp->isSuccess()) {
    // verified!
} else {
    $errors = $resp->getErrorCodes();
}