Two ways to save form content when page goes back in PHP
Release: 2016-07-30 13:31:44
Original
1077 people have browsed it
During the development process, often due to form errors, the information filled in when returning to the page is missing. In order to support page bounce, it can be achieved through two methods in PHP. First, use the Header method to set the message header Cache-controlheader('Cache-control: private, must-revalidate'); //Support page bounceSecond, use the session_cache_limiter method
session_cache_limiter('private , must-revalidate');//Note to write before the session_start methodPS: Cache-Control message header field description
Cache-Control specifies the caching mechanism followed by the request and response. Setting Cache-Control in a request message or response message does not modify the caching process during the processing of another message. The cache instructions during the request include no-cache, no-store, max-age, max-stale, min-fresh, only-if-cached, and the instructions in the response message include public, private, no-cache, no-store, no-transform, must-revalidate, proxy-revalidate, max-age. The meaning of the instructions in each message is as follows:
Bottom: Public indicates that the response can be cached by any cache.
Private indicates that all or part of the response message for a single user cannot be processed by the shared cache. This allows the server to only describe a partial response from a user that is not valid for other users' requests.
no-cache indicates that the request or response message cannot be cached
no-store is used to prevent important information from being released unintentionally. Sending it in the request message will cause both the request and response messages to use caching.
max-age indicates that the client can receive responses with a lifetime no greater than the specified time in seconds.
min-fresh indicates that the client can receive responses with a response time less than the current time plus the specified time.
max-stale indicates that the client can receive response messages beyond the timeout period. If you specify a value for max-stale messages, the client can receive response messages that exceed the specified value of the timeout period.
The above introduces the two methods of PHP to implement page back and save the form content, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31