Captcha Not Working

Hi , i am using captcha in my Signup form. The problem is, it is not showing any image. it just show this text.

"Get a new code"

Clicking on the text gives me error

"Unable to resolve the request "captcha/refresh/1"

On page load it also generates error

"NetworkError: 404 Not Found - http://localhost/myapp/captcha/v/5253d1a155702"

i have checked, jquery is also loaded.

Here is my code for captcha.

Model: Users.php




class Users extends CActiveRecord

{

	public $verifyCode;


        public function rules(){

             return array(

                          array('verifyCode','captcha','allowEmpty'=>!CCaptcha::checkRequirements()),

                    );

	}



Controller: UsersController





class UsersController extends Karmora

{

    public function accessRules()

    {

        return array(

            array('allow', 

                'actions'=>array('create', 'captcha'),

                'users'=>array('*'),

            	),

        );

    }


    public function actions(){

    	return array(

    	// captcha action renders the CAPTCHA image displayed on the user registration page

    		'captcha'=>array(

    			'class'=>'CCaptchaAction',

    			'backColor'=>0xFFFFFF,

    		),

    	);

    }




View: Signup.php





<?php  

//clearing captcha session values to get updated captcha image

	$session = Yii::app()->session;

	$prefixLen = strlen(CCaptchaAction::SESSION_VAR_PREFIX);

	foreach ($session->keys as $key) {

		if (strncmp(CCaptchaAction::SESSION_VAR_PREFIX, $key, $prefixLen) == 0)

		        $session->remove($key);

	}		


	if(CCaptcha::checkRequirements()):					

		echo $form->labelEx($model,'verifyCode', array('class' => 'fieldname')); 

		echo $form->textField($model,'verifyCode');  ?>

		     <span class="captcha">			        	

		           <?php $unique_id = rand(0,9999);	?>

		           <?php $this->widget('CCaptcha', array('buttonOptions' => array('id' => $unique_id),'id'=>'image_captcha')); ?>

		           <?php echo $form->error($model,'verifyCode'); ?>	

		     </span>					        

	<?php endif; ?>



I am unable to understand why it is not wroking. please help me. :(

The captcha ulr should be User/captcha

How i can change this URL?

try this




'class'=>'CaptchaExtendedAction' 

I am not sure it’s work or not.

Not it is not working.

On page load it generate error

"404 Not Found - http://localhost/karmora/captcha/v/5253e81d29360"

it means that file is not found for captcha? i am also using Routing. is it possible that Routing is creating problem.

My URL ROUTE

‘/Signup’ => ‘users/signup’,

The url where CCacthca tries to load the view is controlled by this property.

Check if a captcha url exitsts and if is the same searched by CCActptcha.