I'm trying to write a script that graphs my site traffic data for me. I'm not familiar with imaging with php, so I'm just playing around right now.
First, I ran the phpinfo and verfied that gd is supported:
gd
GD Support enabled
GD Version 1.6.2 or higher
WBMP Support enabled
So I practically copied a sample program:
Code: Select all
<?php
if(!($im = imagecreatetruecolor(500, 250)) echo "error creating im";
$tc = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 1, 5, 5, "This is not a Hello World", $tc);
header("Content-type: image/jpg");
imageJPEG($im);
imagedestroy($im);
?>Also, I'm not really sure what that header() line does for me. Shouldn't it also work if I just removed that line?
Thanks.