PHP code example of emotionloop / visualcaptcha

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

    

emotionloop / visualcaptcha example snippets


session_start();// Only needed once, at the beginning of your PHP files.
$session = new \visualCaptcha\Session( $namespace );

$options = array(
                'adapter' => array(
                    'name'    => 'memory',
                    'options' => array('ttl' => 3600,
                        'namespace' => "captcha-service"),
                ),
                'plugins' => array( 
                    'exception_handler' => array('throw_exceptions' => false),
                ),
            );
        
$captchaWithCache = new \visualCaptcha\Captcha( $this->session,null,null,null, true,$options);