Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
November 17, 2003, 8:12 am
rate this thread
- Fredo Vincentis
November 17, 2003, 10:37 am
The problem with the meta refresh is that it does not work always. I ran
into that problem a while ago with PHP programming. I wanted my browser
window to refresh every time it opened, but the meta tag just wasn't good
enough. In particular when using the "Back" button of the browser - the
window would stay the same.
I found this really great tip on how to do it with PHP - not quite sure
whether you can achieve the same with ASP - it is header functions. You send
a raw HTTP header that forces the browser to refresh every time. It worked
for all browsers I could test except for Safari on the Mac.
Hope this helps.
- Fredo Vincentis
November 18, 2003, 12:36 am
Hmmm... The header location works, but the header expires doesn't work in
Safari when I use the Back button of the browser. I'll show you what I mean:
if you go to http://www.addictivemedia.com.au you will see a Flash menu at
the top. Click onto Company>Management. You will see that the Flash menu
remains highlighted to show the user the section he is in. Now go to
Portfolio>Case Study. If you now use the Back button to go back to
Company>Management, you will notice that the Flash menu highlights the wrong
section. This is because Safari does not reload the page (the Flash menu is
driven by the PHP).
Strange, but it only causes problems in Safari. If you know a solution,
would be great to hear (sorry to the guys who come here for HTML, rather
than PHP). This is the code I use at the moment to force refresh:
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);