W logach serwera mam takie błędy:
[Mon Sep 26 10:32:10 2011] [error] [client 66.249.71.72] PHP Notice: Use of undefined constant red - assumed 'red' in /var/www/strona/Captcha/class.simplecaptcha.php on line 232 [Mon Sep 26 10:32:10 2011] [error] [client 66.249.71.72] PHP Notice: Use of undefined constant green - assumed 'green' in /var/www/strona/Captcha/class.simplecaptcha.php on line 233 [Mon Sep 26 10:32:10 2011] [error] [client 66.249.71.72] PHP Notice: Use of undefined constant blue - assumed 'blue' in /var/www/strona/Captcha/class.simplecaptcha.php on line 234 [Mon Sep 26 10:32:10 2011] [error] [client 66.249.71.72] PHP Notice: Use of undefined constant red - assumed 'red' in /var/www/strona/Captcha/class.simplecaptcha.php on line 232 [Mon Sep 26 10:32:10 2011] [error] [client 66.249.71.72] PHP Notice: Use of undefined constant green - assumed 'green' in /var/www/strona/Captcha/class.simplecaptcha.php on line 233 [Mon Sep 26 10:32:10 2011] [error] [client 66.249.71.72] PHP Notice: Use of undefined constant blue - assumed 'blue' in /var/www/strona/Captcha/class.simplecaptcha.php on line 234 [Mon Sep 26 10:32:10 2011] [error] [client 66.249.71.72] PHP Notice: Use of undefined constant red - assumed 'red' in /var/www/strona/Captcha/class.simplecaptcha.php on line 203 [Mon Sep 26 10:32:10 2011] [error] [client 66.249.71.72] PHP Notice: Use of undefined constant green - assumed 'green' in /var/www/strona/Captcha/class.simplecaptcha.php on line 203 [Mon Sep 26 10:32:10 2011] [error] [client 66.249.71.72] PHP Notice: Use of undefined constant blue - assumed 'blue' in /var/www/strona/Captcha/class.simplecaptcha.php on line 203 [Mon Sep 26 10:32:10 2011] [error] [client 66.249.71.72] PHP Notice: Use of undefined constant red - assumed 'red' in /var/www/strona/Captcha/class.simplecaptcha.php on line 205 [Mon Sep 26 10:32:10 2011] [error] [client 66.249.71.72] PHP Notice: Use of undefined constant green - assumed 'green' in /var/www/strona/Captcha/class.simplecaptcha.php on line 205 [Mon Sep 26 10:32:10 2011] [error] [client 66.249.71.72] PHP Notice: Use of undefined constant blue - assumed 'blue' in /var/www/strona/Captcha/class.simplecaptcha.php on line 205
Fragment kodu:
function generateImage($text = null) { $im = imagecreatefrompng( $this->getBackgroundImage() ); $tColor = $this->getTextColor(); $txcolor = $this->colorDecode($tColor); $bcolor = $this->getBackgroundColor(); $bgcolor = $this->colorDecode($bcolor); $width = $this->getWidth(); $height = $this->getHeight(); $transprency = $this->getTransparency(); $this->im = imagecreate($width,$height); //Linia 203 $imgColor = imagecolorallocate($this->im, $bgcolor[red], $bgcolor[green], $bgcolor[blue]); imagecopymerge($this->im,$im,0,0,0,0,$width,$height,$transprency); $textcolor = imagecolorallocate($this->im, $txcolor[red], $txcolor[green], $txcolor[blue]); $font = $this->getFont(); $fontsize=$this->getFontSize(); $minAngle = $this->getTextMinimumAngle(); $maxAngle = $this->getTextMaximumAngle(); $length = $this->getTextLength(); for($i=0;$i<$length;$i++){ imagettftext( $this->im, $fontsize, $i*15+10, $this->FontSize*1.2, $textcolor, $font, } imagepng($this->im); imagedestroy($this->im); } function colorDecode( $hex ){ //Linia 230 return $decoded; } }
Próbowałem do kolorów red, blue green dodawac quote ( $imgColor = imagecolorallocate($this->im, $bgcolor["red"], $bgcolor["green"], $bgcolor["blue"]); )
ale nic to nie dało.
W czym tkwi problem?
Proszę o pomoc