0

i creating a site online university course registration form but. i want, when someone use my site if he can click back button or next button in chrome or any browser then site take auto refresh . Please tell me how that possible.

Al-mahbub Khan
  • 199
  • 1
  • 10

2 Answers2

3

To make sure the response contents aren't cached, you should add a Cache-Control: max-age=0 header to the response, which marks it as uncachable. There are some caveats in that area, but googling on "no cache headers" will make that clear for you.

To make sure the browser doesn't cache the form values (whether or not the response was cached), you should disable autocomplete on the form:

 <form ... autocomplete="off">
      ...
 </form>

One step further is to investigate the browser's "history API", which you can hook into using libraries such as Backbone.History.

Gerard van Helden
  • 1,537
  • 8
  • 11
  • wow thanks now my problem is solve
    ...
    in it check box tick is not seen so its help ful it can clear my cache and thanks Indrasinh Bihola and Gerard van Helden
    – Al-mahbub Khan May 25 '15 at 11:27
2

add this in font page it can refresh page

header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
?>

if you use check box then you need to add

    <form ... autocomplete="off">
      ...
 </form>

this can clear your check box tick. so if you click back button in mojila or chrome your page will be auto refresh.

Al-mahbub Khan
  • 199
  • 1
  • 10