Hi,
wieder habe ich Probleme mit dem Captcha und zwar wird es nicht angezeigt. Auf der Kontaktseite schon auf einer anderen Seite nicht!
Hier mein Model
<?php
class suggestions extends CActiveRecord
{
public $verifyCode;
public static function model($className=__CLASS__)
{
return parent::model($className);
}
public function tableName()
{
return 'suggestions';
}
public function rules()
{
return array(
array('type', 'length', 'max' => 10),
array('verifyCode', 'captcha', 'on'=>'insert', 'allowEmpty'=>!Yii::app()->user->isGuest || !extension_loaded('gd')),
);
}
public function relations()
{
return array(
);
}
public function attributeLabels()
{
return array(
'id' => 'Id',
'type' => 'Wordclass',
'ip' => 'Baseform2',
'datum' => 'Statistic',
'verifyCode'=> 'Verification Code',
);
}
public function safeAttributes()
{
return array('type', 'datum', 'verifyCode', 'ip');
}
}
?>
Mein Controller
<?php
class SuggestionsController extends CController
{
const PAGE_SIZE = 50;
public $defaultAction='list';
private $_model;
public function filters()
{
return array(
'accessControl',
);
}
public function actions()
{
return array(
'captcha'=>array(
'class'=>'CCaptchaAction',
'backColor'=>0xEBF4FB,
),
);
}
public function accessRules()
{
return array(
array(
'allow',
'actions' => array('create', 'captcha'),
'users' => array('*'),
),
array('deny',
'users' => array('*'),
),
);
}
Meine View
<?php if(extension_loaded('gd')): ?>
Geben Sie die angzeigten Buchstaben / Zahlen aus dem Bild ein. <br/>
<?php $this->widget('CCaptcha'); ?>
<input type="text" name="verifyCode">
<?php endif; ?>
Das Bild fehlt!
Was übersehe ich? thx & mfg