Yii Framework Forum: Captcha Not Disply Any Image - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Captcha Not Disply Any Image Rate Topic: ***** 1 Votes

#1 User is offline   samilo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 231
  • Joined: 04-October 12

Posted 01 January 2013 - 03:43 AM

Hi All

After i used multiple layouts in my app , then Cpatcha not display any image :(

This my code

Controller :
	public function actions()
	{
		return array(
			// captcha action renders the CAPTCHA image displayed on the contact page
			'captcha'=>array(
				'class'=>'CCaptchaAction',
				'backColor'=>0xFFFFFF,
			),
			// page action renders "static" pages stored under 'protected/views/site/pages'
			// They can be accessed via: index.php?r=site/page&view=FileName
			'page'=>array(
				'class'=>'CViewAction',
			),
		);
	}


model :
public function rules()
{
	return array(
		array('email, password', 'required','message'=>'-- {attribute}  '),
	
 		array('password', 'authenticate'),
        	
  		// verifyCode needs to be entered correctly
	array('verifyCode', 'captcha', 'allowEmpty'=>!CCaptcha::checkRequirements(),'message'=>' {attribute}  Error '),
    	
);

}



...
	<div>
		<?php $this->widget('CCaptcha'); ?>
		<?php echo $form->textField($model,'verifyCode'); ?>
		</div>
...



I tested it on request recorder and it sent and receive requests ?!!
Posted Image

any help please ?
Thanks in advance
0

#2 User is offline   KonApaz 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,327
  • Joined: 21-February 11
  • Location:Greece

Posted 01 January 2013 - 04:15 AM

Hi samilo

Did you observe any difference between one and multiple layout ? (in your code)
Did you modify the components/controller.php ?

Is appeared the bellow html-code In the position of captcha? (check it with firebug)
<img id="yw0" src="..." alt="">
Yii is the best php framework in the world!
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#3 User is offline   samilo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 231
  • Joined: 04-October 12

Posted 01 January 2013 - 04:35 AM

Hi Kon ,

No i didn't modify components/controller.php , But also I changed my url by removed index.php
and set
'showScriptName'=>false,
in config file .

this is source code for Captcha
<img id="yw0" src="/ictproject/site/captcha?v=50e29f8d52a78" alt="" />
0

#4 User is offline   KonApaz 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,327
  • Joined: 21-February 11
  • Location:Greece

Posted 01 January 2013 - 05:01 AM

View Postsamilo, on 01 January 2013 - 04:35 AM, said:

Hi Kon ,

No i didn't modify components/controller.php , But also I changed my url by removed index.php
and set
'showScriptName'=>false,
in config file .

this is source code for Captcha
<img id="yw0" src="/ictproject/site/captcha?v=50e29f8d52a78" alt="" />



check in new browser tab what the url localhost/ictproject/site/captcha?v=50e29f8d52a78 displays.
Yii is the best php framework in the world!
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#5 User is offline   samilo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 231
  • Joined: 04-October 12

Posted 01 January 2013 - 05:07 AM

Result
Posted Image
0

#6 User is offline   KonApaz 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,327
  • Joined: 21-February 11
  • Location:Greece

Posted 01 January 2013 - 05:23 AM

View Postsamilo, on 01 January 2013 - 05:07 AM, said:

Result
Posted Image



according to http://scvinodkumar....contains-error/
the errors may occurs when there are spaces in header http image, but this almost impossible happens in Yii core!

So, Are you sure the only thing you changed is the 'showScriptName'=>false ? if you set it true, will the image displayed ?
Yii is the best php framework in the world!
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#7 User is offline   samilo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 231
  • Joined: 04-October 12

Posted 01 January 2013 - 05:29 AM

I changed it to true but not worked , thanks I guess it 's impossible :) to fix it .
0

#8 User is offline   KonApaz 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,327
  • Joined: 21-February 11
  • Location:Greece

Posted 01 January 2013 - 05:39 AM

View Postsamilo, on 01 January 2013 - 05:29 AM, said:

I changed it to true but not worked , thanks I guess it 's impossible :) to fix it .


So the problem is not the showScriptName,
can you find which is your changes in your multi-layout?
Also compare the single layout and multi-layout issues with firebug and coding.

Let us know what is the problem
Yii is the best php framework in the world!
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#9 User is offline   samilo 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 231
  • Joined: 04-October 12

Posted 01 January 2013 - 05:42 AM

Yes , I will check that ... I guess my problem related to copy/paste code from another project .. So I missed something .
Thanks KonApaz
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users