I am following the blog tutorial but am stuck at adding the captcha image into the add comment form.
The image source is not of an image but the local path of src="/index.php?r=post/captcha".
How is this happening? Can I not run this from my local machine?
Page 1 of 1
Captcha image issue.
#2
Posted 30 May 2009 - 10:31 PM
in that particular uri, php changes the headers to image/jpeg.. so that the browser knows to render it like an image. check this link:
http://www.electrict...ge-headers-php/
it may not render on your computer because you need the php extension gd2. are you using wamp on windows or are you in a linux environment?
http://www.electrict...ge-headers-php/
it may not render on your computer because you need the php extension gd2. are you using wamp on windows or are you in a linux environment?
#3
Posted 31 May 2009 - 11:34 PM
Thanks for the reply.
I don't quite understand. The URI index.php?r=post/captcha should display the captcha image? If that was the case then I would think that the URL http://www.yiiframew...?r=post/captcha would also show a captcha image.
I am running Linux and gd2 and php5-gd are both installed. I have tried this on two computers now running the same set-up.
I don't quite understand. The URI index.php?r=post/captcha should display the captcha image? If that was the case then I would think that the URL http://www.yiiframew...?r=post/captcha would also show a captcha image.
I am running Linux and gd2 and php5-gd are both installed. I have tried this on two computers now running the same set-up.
#5
Posted 01 June 2009 - 12:36 AM
It gives me the login screen. If I'm logged in it returns a Unauthorized error which tells me I need to change the accessRules.
I have fixed this error by adding 'captcha' to the actions array in AccessRules() in PostController.
Thank you.
I have fixed this error by adding 'captcha' to the actions array in AccessRules() in PostController.
Thank you.
#6
Posted 01 June 2009 - 01:15 AM
Hi,
in your post controller (PostController.php) you have to allow captcha action for all users or authenticated. For all users you can do
I hope that this help you
in your post controller (PostController.php) you have to allow captcha action for all users or authenticated. For all users you can do
I hope that this help you
Share this topic:
Page 1 of 1

Help
This topic is locked













