I changed the array item:

'name' => 'captcha' instead and now i have a bad captcha value is wrong
error. - though am entering the right characters



dele454 wrote:
> 
> hi,
> 
> i am trying to verify the text submitted to match that of the captcha. If
> valid(same) echo 'validated'.
> 
> class JoinController extends Zend_Controller_Action
> {
> 
>               public function indexAction(){
>               
>               $this->_helper->layout->setLayout('layout-site');
>               $view = new Zend_View();                
>               // Originating request:
>               $captcha = new Zend_Captcha_Image(array(
>                       'name' => 'foo',
>                       'height' => 100,
>                       'width' => 202,
>                       'wordLen'=> '6',
>                       'expiration' => '300',
>                       'font' =>
> 'C:/xampp/htdocs/xampp/mainevent/public_html/img/font/ravie.ttf',
>                       
> 'imgDir'=>'C:/xampp/htdocs/xampp/mainevent/public_html/img/captcha',
>                       'imgUrl' => '../img/captcha',
>                       'fontSize' => '24',
>                       'class' => 'captcha'
>                       
>                       
>               ));
>               $id = $captcha->generate();
>               $this->view->showCaptcha = $captcha->render($view);
>               
>               
>               
>               if ($captcha->isValid($_POST['captcha'])) {
>                    echo "Validated!";
>                 
>                  }
>                else{ echo "no";
>                print_r($captcha->getMessages());}
>               }       
>        
>               
> 
> }
> 
> When i submit the form it always echos 'no'!. Printing the error message i
> get this
> 
> Array ( [missingValue] => Empty captcha value ) 
> 
> How can i sort this out. I am thinking the captcha will always have a
> different value on post when compared to the text field. How can i resolve
> this.
> 


-----
dee
-- 
View this message in context: 
http://www.nabble.com/Zend_Capcha-tp20300142p20300207.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to