Posts Tagged with captcha

Displaying 1-4 of 4 results.
Resolved: Yii Captcha Broken Image
posted by admin on March 12, 2016
The captcha image is broken (no image appearing). The other components of captcha (links, error matching code etc) seem to work correctly

In Controller:

public function actions() {
return array(
'captcha' => array(
'class' => 'CCaptchaAction',
'backColor' => 0xFFFFFF,
),
);
}


In View:

<?php 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.

Letters are not case-sensitive.</div>
<?php echo $form->error($model, 'verifyCode'); ?>
</div>
<?php endif; ?>


In Model:

public $verifyCode;
....
public function rules() {
return array(
....
....
array('verifyCode', 'captcha', 'allowEmpty' => !CCaptcha::checkRequirements()),
);
}


Why I have this problem?Read more
Resolved: Yii captcha does not work first time
posted by admin on December 22, 2015
I am trying to create register form where I used captcha. I have enabled ejax validation. But the there is a problem, captcha does not work first time. When I generate new captcha code, that works. My code is:

In model,

public $verifyCode;

public function rules()
{
return array(
array('verifyCode','captcha','allowEmpty'=>!CCaptcha::checkRequirements(), 'on'=>'registration'),

array('id, first_name,last_name, email, username, password, password_repeat, user_type, keystring, status, logo_url, last_login_time, create_time, update_time, validation', 'safe', 'on'=>'search'),
);
}

In controller:

public function actions()
{
return array(
'captcha'=>array(
'class'=>'CCaptchaAction',
'backColor'=>0xFFFFFF,
'testLimit'=>3,
),
);
}

In view:

<?php if(CCaptcha::checkRequirements()): ?>
<div class="row">
<?php echo $form->labelEx($model,'verifyCode'); ?>
<?php $this->widget('CCaptcha', array('captchaAction'=>'user/captcha')); ?>
</div>
<div class="formfieldarea">
<div class="form-text"></div>
<div class="form-field">
<?php echo $form->textField($model,'verifyCode'); ?>
<div class="hint">Please enter the letters as shown.

Letters are not case-sensitive.</div>
<?php echo $form->error($model,'verifyCode'); ?>
</div>
</div>
<?php endif; ?>

I have searched in google a lot to find the solution. But did not find. Please help someone.:(Read more
Resolved: CListview Pagination variable
posted by admin on December 25, 2015
within CListview and CGridview when I turn off ajax I set

'ajaxUpdate' = false

but the paging variable comes up with modelname_page=1 how can i set the paging variable to just 'p'
ie so p=1.

I have tried

'pageVar' => 'p'

but this doesn't work as it's not supported.
btw I am using yii 1.1.10Read more
Resolved: Yii captcha does not work after moving site to the hosting
posted by admin on December 22, 2015
In localhost website captcha working well, but after moving to live hosting, captcha stop working. Not show image, break image.Read more