PHP disables page caching. PHP disables page caching. for example, if I have three pages. shopping cart 2. order address and payment method 3. when the order is generated 2-3, the order data is inserted to generate the order information and the PHP method to disable page caching.
For example, I have 3 pages, 1. shopping cart 2. order address and payment method 3. when order generation 2-> 3 is displayed, the order data is inserted to generate order information and items under the order, and the corresponding item data of the shopping cart is cleared.
If you do not want the user to go to the last page, the order has been generated, and then click the return button of the browser to return to the previous page.
On the order address page, add:
Header ("Cache-Control: no-cache, must-revalidate, no-store"); // This no-store is valid in Firefox after it is added.
Header ("Pragma: no-cache ");
Header ("Expires:-1 ");
This page is no longer cached, and a page will jump to the empty shopping cart if it is determined that the shopping cart item is empty. then, the user clicks the browser and returns to the shopping cart page.
Detailed description:
Click the back button to read the cached files in the browser. you can use the cache to disable the back button.
Method: Add the following code in.
Expires (term). description: it can be used to set the expiration time of a webpage. Once the webpage expires, it must be re-transmitted to the server.
Usage:
Note: the GMT time format must be used.
Content = "-1", web pages cannot be cached at any time.
When you access a webpage for the first time, the computer automatically caches the content of the webpage. when you access the same url for the second time, the browser directly calls the original cache, even if your new website is updated, the earlier version is displayed. If it is set to no-catch, local data will not be cached, that is, each request is in the latest version.
However, the preceding three statements are valid in IE and invalid in FF, and the following sentence is added in FF.
There are many ways to disable the back button. this method is only one of them.
For example, if I have 3 pages, 1. shopping cart 2. Order address and payment method 3. when the order is generated 2-3, the order data is inserted to generate order information and...