I am using: WinXP, PHP 4.3.3
I have few problems with GD functions, like this simple code:
- Code: Select all
<?
$imColor = hex2int(validHexColor($_REQUEST['color']));
$im = imagecreate(50,50);
$background = imagecolorallocate($im, $imColor['r'], $imColor['g'], $imColor['b']);
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
function hex2int($hex) {
return array( 'r' => hexdec(substr($hex, 0, 2)), // 1st pair of digits
'g' => hexdec(substr($hex, 2, 2)), // 2nd pair
'b' => hexdec(substr($hex, 4, 2)) // 3rd pair
);
}
function validHexColor($input = '000000', $default = '000000') {
return (eregi('^[0-9a-f]{6}$', $input)) ? $input : $default ;
}
?>
This code on my computer return:
Warning: Cannot modify header information - headers already sent by (output started at f:\inetpub\wwwroot\php\test\gallery\image1.php:1) in f:\inetpub\wwwroot\php\test\gallery\image1.php on line 6
?PNG IHDR22$PLTE?z=ڀIDATx?c`? ?ӻ?ND?B`?
I whould be glad if you help me.
regards



