Location: PHPKode > scripts > php-captcha-generator > gjerokrsteski-php-captcha-generator-efe0ec7/src/_drafts/captcha.php
<?php

error_reporting(E_ALL | E_STRICT);

ini_set('display_errors', 1);

require_once '../CaptchaGenerator.php';

// Einfache Anwendung.
try
{
    $captcha = new CaptchaGenerator(
        dirname($_SERVER["SCRIPT_FILENAME"]).'/arial.ttf',
        dirname($_SERVER["SCRIPT_FILENAME"]).'/pwdimage.png',
        4
    );

    // Intervene here the phrase
    // and save it into the database or at the session.
    $_SESSION['security-phrase'] = $captcha->getPhrase();

    $captcha->render();
}
catch (InvalidArgumentException $e)
{
    print $e->getMessage();
}
Return current item: php-captcha-generator