I have built a site that allows people to choose a cartoon character and dress it. There are a number of pages where they add the clothes and then a personalised message. It all works fine in all browsers…except IE (no surprise there). When an item of clothing is added, it doesn’t display on the cartoon animal until you refresh the page. Also if you go back (either using the back button on the page or browser) it ‘remembers’ what you added and still displays it.
The site is built using bootstrap and the selections are saved using parameters in the url. Chrome and Firefox behave nicely.
The page can be seen here and works until you choose the clothes
http://www.babadoodle.co.uk/buy-childrens-nursery-art.php
Would really appreciate if anyone can suggest where I have gone wrong. I’ve already tried forcing the cache to clear.
Thanks in advance.
So after an afternoon of head scratching and googling, I’ve discovered that this is not a cache problem. And also the get variables are being passed properly in the url to the next page. The problem is with the image that is constructed using the variables passed to the page. When the customer selects an animal, skirt, top, balloon etc the page takes the variables for each of these images and constructs a new image to display. This works well in every browser except IE. Can anyone shed any light on why it wouldn’t work in that browser? This is an example of the code I’ve used…
<?php
$photo = imagecreatefrompng("images/yellowbackground.png");
$w = imagesx($photo);
$h = imagesy($photo);
imagealphablending($photo,true);
$animalimg = imagecreatefrompng("images/animals/".$species_url."-".$dir_url.".png");
imagecopy($photo,$animalimg,0,0,0,0,$w,$h);
$underwear = imagecreatefrompng("images/boys-underwear.png");
imagecopy($photo,$underwear,0,0,0,0,$w,$h);
$trouserimg = imagecreatefrompng("images/boys-trousers/".$trousers.".png");
imagecopy($photo,$trouserimg,0,0,0,0,$w,$h);
$copyright = imagecreatefrompng("images/copyright-with-text2.png");
imagecopy($photo,$copyright,0,0,0,0,$w,$h);
imagejpeg($photo,"newimage.png",100);
echo'<img class="compiledimage" src="newimage.png" alt="" title=""/>';
?>
Finally got it working.
In case anyone has the same problem what I did was make the new created image have a different name on every page where this code existed and then at the start of each of the pages put some code that deleted the image if it existed e.g.
<?php
if (file_exists('newimageegirl.png')) {
unlink('newimaggirl.png');
}
if (file_exists('newimageegirl1.png')) {
unlink('newimaggirl1.png');
}
?>