I run php V4.3.1 with gd2 enabled on my Win 98 pc at home and the following code works fine:
file a.php
<?php
session_start();
session_register("x");
session_register("y");
$fileName = "image01.png";
?>
<html>
<head></head>
<body>
<?php
echo "<img src='b.php?fileName=$fileName' border='0'>";
?>
</body>
</html>
file b.php
<?php
session_start();
$fileName = $_GET["fileName"];
$fileName = "images/largeimages/".$fileName;
$m = imagecreatefrompng($fileName);
header("Content-type: image/png");
imagepng($m);
imagedestroy($m);
?>
(I've missed out the processing with the $x and $y arrays for simplicity)
when I load it onto my server webspace PHPV4.1.2 gd1.6.2
it doesn't work, the image fails to appear, yet when I run the following file by typing the full URL address in the URL bar of the browser it works ok, the image appears.
<?php
$fileName = "images/largeimages/image01.png";
$m = imagecreatefrompng($fileName);
header("Content-type: image/png");
imagepng($m);
imagedestroy($m);
?>
Am I doing something wrong?
I've also tried $HTTP_GET_VARS without success
Thanks