I have tried to get the captcha image to show for a long time now… ived checked meny threads in this forum and i cant finde out the problem. Captcha image those show under Contact.
Any idees?
PHP Info:
DOM/XML enabled
DOM/XML API Version 20031129
libxml Version 2.7.3
HTML Support enabled
XPath Support enabled
XPointer Support enabled
Schema Support enabled
RelaxNG Support enabled
checkRequirements() returns true.
UserController
public function accessRules()
{
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','view', 'create'),
'users'=>array('*'),
),
array('allow',
'actions' => array('captcha'),
'users' => array('*'),
),
User Model
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('verifyCode', 'captcha', 'allowEmpty'=>!CCaptcha::checkRequirements()),
There seems to be nothing wrong in your code, and the html output seems quite fine.
It should be a problem regarding the setup of web server or PHP.
Do you mean that you get a blank white image without captcha letters? Or no image at all?
What about the font file? The default font file for CCapthca is ‘/framework/web/widgets/captcha/Duality.ttf’. Does the running environment of your app have it in the right place and with the right name?
What is the ‘memory_limit’ value in your phpinfo()?
sorry, its not a message, its the icon for images that not can be found thats shows insted for the captacha image, im not abel to post in this thread when im new in this forum.
also instead of using separate array, just add to existing.
So instead of:
public function accessRules()
{
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','view', 'create'),
'users'=>array('*'),
),
array('allow',
'actions' => array('captcha'),
'users' => array('*'),
),
Try this:
public function accessRules()
{
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','view', 'create', 'captcha'),
'users'=>array('*'),
),