Captcha Confusion - help me please

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… :(

Make sure you don’t messed up the routing rules…

I don’t fully understand what you mean. =\

Where and how would I be doing that. It seems like something that could be happening though… :o

in config/main.php

Well I didn’t change anything in there and I am just using the default PATH format setting. Is there anything I could be overlooking in that regard? Here is what I have in there…




'urlManager'=>array(

                    'urlFormat'=>'path',

                    'rules'=>array(

                            '<controller:\w+>/<id:\d+>'=>'<controller>/view',

                            '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',

                            '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

                    ),

            ),



Really need this working… please help if you can. =[

Fixed it…

Be sure to add the captcha action to your accessRules() so the user (groups) can access it.

Not a cool mistake. >:(