I get this message error when I am trying to read that php:
X-Powered-By: PHP/4.0.1pl2 Content-type: text/html
Fatal error: Call to undefined function: imagefontwidth() in d:\www\test\button\button.php on line 27
This is the php:
define("TextFONT", "3");
function ConvertColor($hexVal){
$ColorVal = array(3);
for($i = 0; $i < 3; $i++)
$ColorVal[$i] = HexDec(substr($hexVal, $i * 2, 2));
return $ColorVal;
}
$width = strlen($txt) * ImageFontWidth(TextFONT);
$offset = 2;
$imgFRAME = ImageCreate($width, ImageFontHeight(TextFONT)+$offset);
list($red, $green, $blue) = ConvertColor($bg);
$bgCOLOR = ImageColorAllocate($imgFRAME, $red, $green, $blue);
list($red, $green, $blue) = ConvertColor($fg);
$fgCOLOR = ImageColorAllocate($imgFRAME, $red, $green, $blue);
ImageFill($imgFRAME, 1, 1, $bgCOLOR);
ImageString($imgFRAME, TextFONT, 1, 1, $txt, $fgCOLOR);
header("Content-type: image/gif");
ImageGIF($imgFRAME);
ImageDestroy($imgFRAME);
Can anyone help??
Rygars