Back button re-submit form data ($_POST)

后端 未结 6 947
鱼传尺愫
鱼传尺愫 2020-11-27 19:23

My problem is that the back button causes the browser to say something like \"Page expired\" when the previous page was created by a form.

Example:

  • pag
6条回答
  •  抹茶落季
    2020-11-27 20:08

    This applies to PHP and IE8.

    Not only must you set cacheing to private, but you must remove the 4 cacheing headers and this can only be done with PHP 5.3. In PHP 5.2 you can only set the 4 headers to blank values if using the Zend Framework's setHeader() method. For some reason is not sufficient on IE8 to set the 4 header values to empty values. Here's the code for PHP 5.3:

        header_remove("Expires");
        header_remove("Cache-Control");
        header_remove("Pragma");
        header_remove("Last-Modified");
    

提交回复
热议问题