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
https://forums.phpfreaks.com/topic/239902-reloadrefresh-on-back-button/
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?

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?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.