No idea why this is happening…
I have my own form that needs Captcha. I looked at the working included contact form. I replicated that. And for some reason NO IMAGE APPEARS on the new form.
Here is what I have:
Model:
public $verifyCode;
public function rules()
{
return array(
array('verifyCode', 'captcha', 'allowEmpty'=>!CCaptcha::checkRequirements()),
);
}
public function attributeLabels()
{
return array(
'verifyCode'=>'Verification Code',
);
}
Controller:
public function actions()
{
return array(
'captcha'=>array(
'class'=>'CCaptchaAction',
'backColor'=>0xFFFFFF,
),
);
}
View:
if(CCaptcha::checkRequirements()): ?>
<div class="row">
<?php echo $form->labelEx($model,'verifyCode'); ?>
<div>
<?php $this->widget('CCaptcha'); ?>
<?php echo $form->textField($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>
<?php echo $form->error($model,'verifyCode'); ?>
</div>
<?php
endif;
Am I missing something?? Maybe in the controller? I have no idea why the image isn’t there. The widget seems to work as I do get the “New Code” link and textbox and all that but the image is just a broken image.
Help please…