Jump to content

explorer and form refresh


zimmo

Recommended Posts

I am having difficulty getting the page cache to not reload content in a form when you hit refresh. I have used the meta tags which do not work well, so I then tried the php code to stop it. The only thing that happens is when you hit the back button it states the page has expired and to do a refresh. When you refresh it loads the information in the form fields that you entered before.

 

I would have thought that it would have given me a blank form again?

 

The php code I am using to stop the caching of the form is:

<?php
// prevent caching (php)
header('Cache-Control: no-cache');
header('Pragma: no-cache');
header('Expires: ' . gmdate(DATE_RFC1123, time()-1));
?>

Any ideas how to stop this?

Link to comment
https://forums.phpfreaks.com/topic/198277-explorer-and-form-refresh/
Share on other sites

What browser are you experiencing this behaviour with? All browsers handle caching etc. slightly differently. If you want to force pages to be a fresh copy when the back button is used one option is to use JavaScript to attach an onunload event. This can be an empty event that does nothing, it's very existence should prevent (at least the big 5 browsers) from caching the page. Since it is JS based and there are no true standards though, there are at least two different methods for attaching the event. The JS boards would be a better place to ask for details on that specific topic though.

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.