I have a problem using recaptcha in my app. I have a registration form with username, email, password and recaptcha.
-
If I fill in correct recaptcha and for example email is not filled, I got error about missing email, that’s OK
-
If I fill in incorrect recaptcha and email is not filled, I got error wrong recaptcha and missing email, that’s also OK
-
If I fill in correct recaptcha, and whole form is filled (correctly), I got error about wrong recaptcha. I tested multiple times, and that’s the problem.
I’m using recaptcha extension, and I’ve downloaded recaptchalib.php.
In my form I use it like this:
<section>
<?php $this->widget('application.extensions.recaptcha.EReCaptcha',
array('model'=>$model, 'attribute'=>'verifyCode',
'theme'=>'red', 'language'=>'en',
'publicKey'=>'.....')) ?>
</section>
then in the model
public function rules() {
$rules = array(
array('username, password, verifyPassword, email', 'required'),
...
array('verifyCode',
'application.extensions.recaptcha.EReCaptchaValidator',
'privateKey'=>'....','message' => Yii::t("module_user","Wrong captcha."))
);
}
Could you please give me a hint what could be wrong? thanks.