public function display($captcha_id) { $this->init(); $text = xE::$memcache->get('captcha.' . $captcha_id, TRUE); if ($text === FALSE) { exit('Not found.'); } if (!xE::$memcache->add('captchaseen.' . $captcha_id, 1, 3600)) { exit('Already viewed.'); } require_once QUICKY_DIR . 'plugins/Captcha/Captcha_draw.class.php'; $image = new CAPTCHA_draw(); $image->skin = $this->skin; $image->text = $text; $image->show(); }
<?php session_start(); if (!isset($_REQUEST['id']) || !isset($_SESSION['captcha'][$id = intval($_REQUEST['id'])])) { exit(';-)'); } //if ($_SESSION['captcha'][$id][1]) {exit(':-D');} $_SESSION['captcha'][$id][1] = 1; require_once '../plugins/Captcha/Captcha_draw.class.php'; $CAPTCHA = new CAPTCHA_draw(); $CAPTCHA->text = $_SESSION['captcha'][$id][0]; $CAPTCHA->show();