PHP code example of brainfoolong / justnocaptcha

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

    

brainfoolong / justnocaptcha example snippets


use BrainFooLong\JustNoCaptcha\JustNoCaptcha;
JustNoCaptcha::$verifiedSolutionsFolder = 'path-to-a-local-new-empty-temporary-directory';
JustNoCaptcha::$challengeSalt = 'yourrandomsecretsalt';
$puzzles = 50;
$difficulty = 4;
$challenge = JustNoCaptcha::createChallenge($puzzles, $difficulty); // send this to client
$solution = "comes from the client"; // to test, $solution = JustNoCaptcha::solveChallenge($challenge);
$verification = JustNoCaptcha::verifySolution($challenge, $solution); // 
if ($verification){
    // success
}