PHP code example of mathsgod / jwt-recaptcha

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

    

mathsgod / jwt-recaptcha example snippets


$secret;

$re = new ReCaptcha($secret);
$hash = $re->hash();

echo $hash["token"]; //token sent to user, use for verify later
echo $hash["image"]; //recaptcha image


$re = new ReCaptcha($secret);
$code;//get from user
$token;//get from user sent before

if($re->verify($code,$token)){
    //correct code
}else{
    //incorrect code 
}