Hi All,
I would like to create form with captcha. But my captcha element can’t not show image on IE,FireFox …
I have enable to load extension=php_gd2.dll file.
extension=php_gd2.dll
And my form with yii framework
<?php
$form = $this->beginWidget('CActiveForm',array('id'=>'newuser'));
?>
...
<tr>
<td><?php $form->widget('CCaptcha',array('showRefreshButton'=>true,
'buttonLabel'=>"get new code")); ?>
</td>
<td><?php echo $form->textField($model,'verifyCode')?></td>
</tr>
...
<?php $this->endWidget();?>
And my model
class NewUser extends CFormModel
{
public $name;
public $pass;
public $repass;
public $email;
public $date;
public $dateCreate
public $verifyCode;
public function rules()
{
return array(
array('name, pass,repass,email,date', 'required','message'=>'{attribute} không thể bỏ trống'),
array('email','email','message'=>'{attribute} không hợp lệ'),
array('date','date','format'=>'dd-mm-yyyy'),
array('pass','compare',
'compareAttribute'=>'repass',
'operator'=>'==',
'message'=>'Mật khẩu không giống'),
);
}
But default control "contact" has show image captcha. And my form but not. Help me, I start to learning yii framework.