Jump to content

Reload/Refresh on back button


liamthebof

Recommended Posts

Hello,

 

Hopefully a simple question.

 

<?php
  header("Cache-Control: private, must-revalidate, max-age=0");
  header("Pragma: no-cache");
  header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
  echo date('l jS \of F Y h:i:s A');
  ?>

^^Does not work, except IE7

 

When I click on a link off of the above page, then hit the back button on the browser, I need the page to reload so that the new 'date' will be echoed.

 

Must be multi browser compatible. Any solution appreciated, JS possibly?

 

Thanks

 

 

 

Link to comment
Share on other sites

Where is edit post?

 

Anyway, updated code:

<?php
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
echo time();
?>
<a href="http://google.com">aaaaaaaaaaaaa</a>

 

This works now for Firefox 4, IE8, Chrome 12.

Does not work for Opera 11 however, any ideas?

Link to comment
Share on other sites

Converted page to this:

<?php
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<!--the rest of my page-->
<body>
    <?php echo time(); ?>
<a href="http://google.com">aaaaaaaaaaaaa</a>
</body>
</html>

 

Still not working in Opera.

Any suggestions?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.