i am using this code to add captcha to my page
if (!isset($this->session->passedRegisterCaptcha) ||
!$this->session->passedRegisterCaptcha)
{
//if we have set captcha in the session for this request - use
it, else generate new one
if (isset($this->session->registerCaptcha))
{
$captchaCode = $this->session->registerCaptcha;
}
else
{
$md5Hash = md5($_SERVER['REQUEST_TIME']);
$captchaCode = substr($md5Hash, rand(0, 25), 5);
$this->session->registerCaptcha = $captchaCode;
}
$captcha = new Zend_Form_Element_Text('captcha');
$captcha->setLabel('Enter the text')
->addValidator(new Zend_Validate_Identical($captchaCode))
->addValidator($validatorNotEmpty, true)->setRequired(true);
$captchaDecorator = new My_Form_Decorator_Captcha();
$captchaDecorator->setOption('namespace',
'User')->setOption('captchaId', 'registerCaptcha');
$captchaDecorator->setTag('div');
$captcha->addDecorator($captchaDecorator);
$form->addElement($captcha);
}
i am not getting the captcha image but getting an error
Strict Standards: Creating default object from empty value in
C:\wamp\www\new\application\modules\default\controllers\UserController.php
on line 150
and line 150 states :-
$this->session->registerCaptcha = $captchaCode ;
Please help.
Regards
Kusum
--
View this message in context:
http://www.nabble.com/Captcha-image-not-appearing-tp24414072p24414072.html
Sent from the Zend Framework mailing list archive at Nabble.com.