PHP code example of codelords / next-capture

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

    

codelords / next-capture example snippets


// Include Composer autoloader
tchaGenerator\ImageCaptchaGenerator;

$captchaGenerator = new ImageCaptchaGenerator();
$captchaChallenge = $captchaGenerator->generate();
$captchaImagePath = $captchaGenerator->saveImage('/path/to/save');

// Display $captchaImagePath in your HTML form


// Include Composer autoloader
chaGenerator\AudioCaptchaGenerator;

$captchaGenerator = new AudioCaptchaGenerator();
$captchaChallenge = $captchaGenerator->generate();
// Output $captchaChallenge as an audio element in your HTML

// Include Composer autoloader
tchaGenerator\TextCaptchaGenerator;

$captchaGenerator = new TextCaptchaGenerator();
$captchaChallenge = $captchaGenerator->generate();
// Display $captchaChallenge in your HTML form