PHP code example of notcod / captcha

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

    

notcod / captcha example snippets


      //$secret = "Captcha", $secretInt = 15, $letters = 5, $fontSize = 25, $angle = 10, $x = 25, $y = 45
    $captcha = new Captcha("Captcha", 15, 5, 25, 10, 25, 45);
    if (isset($_POST["login"])) {
        if ($captcha->isValid($_POST["_captcha"], $_POST["_token"])) {
            echo "Welcome dear, ".$_POST["username"];
        }else{
            echo "invalid captcha!";
        }
    }