ie quirk with php header

Soldato
Joined
25 Sep 2003
Posts
3,750
Location
Manchester
I've been dabbling in some php and thought I had finally achieved what I wanted from it only ie came along and spoiled everything.

ie seems to have a problem with cache, with my php i'm constructing a url from a very basic login form. Basically you type in a word and depending on the word it constructs a url and then sends you to it. So, something like this is constructed:

header("Location: gallery.php?galloc=".$path."/#/content/".$path."/0-intro1.jpg/");

In all the other browsers this works fantastic but in ie8 it launches the previous gallery as it seems to be holding it in cache and then doesn't read the new constructed url.

I tried adding in a random number in to the url to try and make ie realise it was a different url but to no avail, that looked something like this where $rando was just a random number.

header("Location: gallery.php?ver=".$rando."?galloc=".$path."/#/content/".$path."/0-intro1.jpg/");

Does anyone have any clue why ie isn't playing nicely? Thanks for any help with this, I've been on this error for days now and I need help! :(
 
Last edited:
Finally found what seems to be the answer, putting

header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
header("cache-Control: no-cache");
header("expires: 0");

forces ie to clear its cache thus allowing everything to work as expected!
 
Back
Top Bottom