public function __construct($config) { $this->config = $config; parent::__construct($config); }
die('You cannot access the captcha directly. Sorry'); } if (isset($_GET['hncaptcha'])) { $_POST['hncaptcha'] = $_GET['hncaptcha']; } if (isset($_GET['public_key'])) { $_POST['public_key'] = $_GET['public_key']; } if (isset($_GET['private_key'])) { $_POST['private_key'] = $_GET['private_key']; } // Please type in all needed values before run the script! require_once "hn_captcha.class.x1.php"; // ConfigArray $CAPTCHA_INIT = array('tempfolder' => constant('BASE_DIR') . 'managed_code/cache/', 'TTF_folder' => constant('BASE_DIR') . 'packages/blueprint/fonts/', 'TTF_RANGE' => array('Activa.ttf', 'Gemerald.ttf'), 'chars' => 5, 'minsize' => 20, 'maxsize' => 30, 'maxrotation' => 25, 'noise' => TRUE, 'websafecolors' => TRUE, 'refreshlink' => TRUE, 'lang' => 'en', 'maxtry' => 3, 'badguys_url' => '/', 'secretstring' => '098-983 4okj akj adsf09809*)(*)(*@#$)(* lmn lkjhasdnbvamncvjd9f87y9837 rhjn89doihjnad9s8fouijhnasv 98ua938', 'secretposition' => 24, 'debug' => FALSE, 'counter_filename' => constant('BASE_DIR') . 'managed_code/cache/captcha_count.txt', 'prefix' => 'hn_captcha_', 'collect_garbage_after' => 20, 'maxlifetime' => 60); $captcha = new hn_captcha_X1($CAPTCHA_INIT); if ($captcha->garbage_collector_error) { // Error! (Counter-file or deleting lost images) echo "<p><br><b>An ERROR has occured!</b><br>Here you might send email-notification to webmaster or something like that.</p>"; } switch ($captcha->validate_submit()) { // was submitted and has valid keys case 1: // PUT IN ALL YOUR STUFF HERE // echo "<p><br>Congratulation. You will get the resource now."; echo "<br><br><a href=\"" . $_SERVER['PHP_SELF'] . "?download=yes&id=1234\">New DEMO</a></p>"; break; // was submitted with no matching keys, but has not reached the maximum try's // was submitted with no matching keys, but has not reached the maximum try's case 2: echo $captcha->display_form();