hellowww,
im wondering why i cant save a user model in my database when i use captcha in my register form. anyone?
here is my controller:
public function actions()
{
return array(
// captcha action renders the CAPTCHA image displayed on the contact page
'captcha'=>array(
'class'=>'CCaptchaAction',
'backColor'=>0xFFFFFF,
),
);
}
controller action create
if(isset($_POST['User']))
{
$model->attributes=$_POST['User'];
$model->save();
view
<?php if(extension_loaded('gd')): ?>
<div class="row">
<?php echo CHtml::activeLabelEx($model,'verifyCode'); ?>
<div>
<?php $this->widget('CCaptcha'); ?>
<?php echo CHtml::activeTextField($model,'verifyCode'); ?>
</div>
<div class="hint">Please enter the letters as they are shown in the image above.
<br/>Letters are not case-sensitive.</div>
</div>
<?php endif; ?>
in my user model rules
array('verifyCode','safe','on'=>'create'),
array('verifyCode', 'captcha', 'allowEmpty'=>!CCaptcha::checkRequirements()),
saving is successfull without captcha, anyone?? thanks in advance