HTML_QuickForm_CAPTCHA
[ class tree: HTML_QuickForm_CAPTCHA ] [ index: HTML_QuickForm_CAPTCHA ] [ all elements ]

Source for file qfcaptcha_image.php

Documentation is available at qfcaptcha_image.php

  1. <?php
  2. /**
  3.  * HTML_QuickForm_CAPTCHA example - Image generator
  4.  *
  5.  * PHP versions 4 and 5
  6.  *
  7.  * @category   HTML
  8.  * @package    HTML_QuickForm_CAPTCHA
  9.  * @subpackage Examples
  10.  * @author     Philippe Jausions <Philippe.Jausions@11abacus.com>
  11.  * @copyright  2006-2008 by Philippe Jausions / 11abacus
  12.  * @license    http://www.opensource.org/licenses/bsd-license.php New BSD
  13.  * @version    CVS: $Id: qfcaptcha_image.php,v 1.1 2008/04/26 23:27:32 jausions Exp $
  14.  * @filesource
  15.  * @link       http://pear.php.net/package/HTML_QuickForm_CAPTCHA
  16.  * @see        qfcaptcha_form_image.php
  17.  * @see        qfcaptcha_form_random.php
  18.  */
  19.  
  20. // Require the class before opening the session
  21. // so the instance unserialize properly
  22. require_once 'Text/CAPTCHA.php';
  23. require_once 'Text/CAPTCHA/Driver/Image.php';
  24.  
  25.  
  26. header('Content-Type: image/jpeg');
  27.  
  28. $sessionVar (empty($_REQUEST['var']))
  29.               ? '_HTML_QuickForm_CAPTCHA'
  30.               : $_REQUEST['var'];
  31.  
  32. // Force a new CAPTCHA for each one displayed
  33. $_SESSION[$sessionVar]->setPhrase();
  34.  
  35. echo $_SESSION[$sessionVar]->getCAPTCHAAsJPEG();
  36.  
  37. ?>

Documentation generated on Mon, 11 Mar 2019 15:21:03 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.