验证capcha zend不正确

时间:2015-04-09 09:24:23

标签: zend-framework

我有代码:

 $messages = array();
 $isValid = TRUE;
 $captcha = $this->_getParam('captcha_code', '');
 if ( ! Captcha::validate($captcha)){
     $isValid = FALSE;
     $messages = array_merge($messages, array('Incorrect capcha.'));
 }
                }
 if ($isValid AND count($messages) == 0) {
        .............
 }
 else {
       Captcha::destroy();
 }
 $this->view->register_messages = $messages;

并查看:

<input name="captcha_code" type="text" class="input-text"/>
<?php if (isset($this->register_messages) && count($this->register_messages) > 0): ?>
<div class="alert-3">
<?php foreach ($this->register_messages as $message): ?>
<div><?= $message ?></div>
<?php endforeach; ?>

但是当我输入正确的capcha时,它仍然显示“错误的capcha”。我用zend 1 请帮我找到这个bug。非常感谢!

0 个答案:

没有答案