페이지가 제출되고 보안 문자의 isValid()
메서드가 호출 될 때 Zend_Captcha
과 관련된 문제가 항상 false를 반환합니다. 이 문제는 내가 염려하는 한 일해야하기 때문에 내 견과를 몰고 간다.zend_captcha는 항상 실패합니다.
가 나는 값이 양식에 입력 된 것을 검증하기 위해 올 때 그러나 그것은이다, 모든 작품
$captcha = new Zend_Captcha_Image('captcha',
array(
'captcha' => array(
'name' => 'graduatesignupcaptcha',
'wordlen' => 6,
'font' => $this->config->captcha->font,
'imgDir' => $baseUrl.'/images/captcha/',
'imgUrl' => $this->config->webserver->name.'/images/captcha/',
)
)
);
$captcha->setHeight(80)
->setTimeout(300);
내가 평소 양식 유효성 검사를 수행 컨트롤러의 동작 기능의 상단에이 선언에 의해 것을 시작 보안 문자에 대해서는 항상 false를 반환합니다.
//next we check the captcha text to ensure that the form is a person not a script
$captchaText = $form->getElement('captchainput')->getValue();
$captchaId = $form->getElement('captchaid')->getValue();
//$captchaSession = new Zend_Session_Namespace('Zend_Form_Captcha_'.$captchaId);
$captchaArray = array(
'id' => $captchaId,
'input' => $captchaText
);
if(!$captcha->isValid($captchaArray)){
$log->log(implode(",",$captcha->getErrors()), Zend_Log::DEBUG);
$form->getElement('captchainput')->setErrors(array('messages' => 'Bad security code'));
$formFailed = true;
}
내가 이렇게 제가 점점 내 양식 생성되는 이미지를 일치에 숨겨진 요소로 저장하고있는 ID 만에 상관없이 항상 실패 할 수 있도록 확인했습니다.
나는 여기에 간단한 것을 놓치고 있습니까 ?? 아니면 이것을 처리하는 더 좋은 방법이 있습니까 ??
감사합니다.
덕분에, 그것은이 (가) 위의 저 문제를 찾을 수 도왔 사용하여 $ captchaId 문제였다 작동합니다. 감사 –