Hi folks,
First post....tried Google but unfortunately my problem doesn't lend to a good search query.
So here's the deal. I'm using WAMP5 for editing locally. I don't have webspace, but right now I don't really need it.
I'm playing with image loading using PHP. I used the direct code from PHP.net to get started:
<?php
function LoadPNG($imgname)
{
$im = @imagecreatefrompng($imgname); /* Attempt to open */
if (!$im) { /* See if it failed */
$im = imagecreatetruecolor(150, 30); /* Create a blank image */
$bgc = imagecolorallocate($im, 255, 255, 255);
$tc = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 150, 30, $bgc);
/* Output an errmsg */
imagestring($im, 1, 5, 5, "Error loading $imgname", $tc);
}
return $im;
}
header("Content-Type: image/png");
$img = LoadPNG("KRHMap.png");
imagepng($img);
?>
Now, when this loads I get no image. All I get is the name of the page. No source code, nothing. The page is called map.php and when it loads all that shows is:
http://localhost/random/map.php
There's no source code, nothing. Is there something in the php.ini file that I have to change in order to get this to work? I really don't feel like buying webspace just to play around if I can do it locally.
Any help is greatly appreciated.
Thanks
Joel