I currently have a imagecreatefrompng function and it works, but when I use an IF statement on it, then it doesn’t work and shows it cannot load image… here is what I have:
$design = $_GET["design"];
if ($design == "DESIGN_1") { $image = imagecreatefrompng('designs/hill.png'); }
if ($design == "DESIGN_2") { $image = imagecreatefrompng('designs/hill2.png'); }
In the header I have:
http://www.website.com/create.png?design=DESIGN_1
it displays the HILL.PNG
But when I have this following in header:
http://www.website.com/create.png?design=DESIGN_2
it doesn’t display HILL2.PNG but shows the image not found symbol.
PS. Both images are in the designs folder.
Can you view the second
.pngin a browser if you navigate to it? Could it be a malformed image file? Since the code appears to be fine, and it’s actually trying to display an image… I have to think that there’s a problem with the image itself.