Hello,
I'm fairly new to PHP, and I'm trying to get the GD2 library working but I am having no luck. I have installed the library, and when I run phpinfo(); it shows that it is up and running, and all file types are supported. However, when I run the following code snippet nothing is displayed:
<?php
$im = @imagecreate (200, 100) or die ( "cannot create a new gd image.");
$background_color = imagecolorallocate ($im, 240, 240, 240);
$border_color = imagecolorallocate ($im, 50, 50, 50);
$text_color = imagecolorallocate ($im, 233, 14, 91);
imagerectangle($im,0,0,199,99,$border_color);
imagestring ($im, 5, 10, 40, "a simple text string", $text_color );
header ("content-type: image/png");
imagepng ($im);
?>
I have been struggling with this for a couple of weeks now with no luck. Any help would be greatly appreciated.