PHP code example of maatify / captcha-all-in-one

1. Go to this page and download the library: Download maatify/captcha-all-in-one 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/ */

    

maatify / captcha-all-in-one example snippets



/**
 * Created by Maatify.dev
 * User: Maatify.dev
 * Date: 2024-08-10
 * Time: 12:17 AM
 * https://www.Maatify.dev
 */
 
use Maatify\CaptchaV1\CaptchaManager;


    // ===== get result in array format
    $result = $captcha->getResponse();
    
    // ====== get bool of validation 
    $result = $captcha->isSuccess();
    
    // ====== using maatify json on error response with json code with die and if success there is no error
    $captcha->jsonErrors();

} catch (Exception $e) {

    echo $e->getMessage();
    
}

if(!empty($config['type'])){
    switch ($config['type']) {
        case 'turnstile':