I have this code, but I just get the X in the image tag.
I think it has something to do with the header as if i dont return it i get the symbols accross the screen.
hope you guys can help
thanks
slh
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?
class shape{
function square(){
$img_handle = ImageCreate (20, 230) or die ("Cannot Create image");
$back_color = ImageColorAllocate ($img_handle, 0, 10, 10);
$txt_color = ImageColorAllocate ($img_handle, 233, 114, 191);
ImageString ($img_handle, 31, 5, 5, "My first Program with GD", $txt_color);
$myHeader = header ("Content-type: image/png");
return $myHeader;
ImagePng($img_handle);
imagedestroy($img_handle);
}
}
//include("dbConnect.php");
$show = new shape();
$show->square();
print '<img src="'. "square()" .'">';
?>
</body>
</html>