Advertisement
d3n1S

PEAR Text_CAPTCHA 0.4.0 alpha

May 22nd, 2014
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. $imageOptions = array(
  2.             'font_size' => 24,
  3.             'font_path' => Zend_Registry::get('config')->paths->data,
  4.             'font_file' => 'segoeprb.ttf',
  5.             'text_color' => '#DDFF99',
  6.             'lines_color' => '#CCEEDD',
  7.             'background_color' => '#555555'
  8.         );
  9. $captcha = Text_CAPTCHA::factory('Image');
  10. $captcha->init(180, 60, $phrase, $imageOptions);
  11. $session->phrase = $captcha->getPhrase();
  12. // disable auto-rendering since we're outputting an image
  13.         $this->_helper->viewRenderer->setNoRender();
  14.         header('Content-type: image/png');
  15.         echo $captcha->getCAPTCHAAsPng();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement