Php one page back

Source: Internet
Author: User
Tags php form
Use onclick = "history. go (-1); "or onclick =" history (back) "; php form after submission and then back, the content of the form is cleared by default (when session_start is used ), solution: after session_start (), write h php before the character output and go back to the page.
Use onclick = "history. go (-1);" or onclick = "history (back )";


Php forms are submitted and then rolled back. The content of the form is cleared by default (when session_start is used ),
The solution is to write it after session_start () and before the character output
Header ("Cache-control: private ");

The Cache of web pages is controlled by "cache-control" in the HTTP message header. common values include private, no-Cache, max-age, and must-revalidate, the default value is private. The function of browser review is divided into the following situations:
(1) open a new window
If the values are private, no-cache, and must-revalidate, the server will be accessed again when a new window is opened.
If the max-age value is specified, the server will not be accessed again within the time range. for example:
Cache-control: max-age = 5 (indicating that the server will not be accessed again within 5 seconds after the webpage is accessed)
(2) press enter in the address bar.
If the value is private or must-revalidate, the server will be accessed only during the first access and will not be accessed in the future.
The value is no-cache.
If the value is max-age, the access will not be repeated before expiration.
(3) back and press the button
If the values are private, must-revalidate, and max-age, no re-access is performed,
If the value is no-cache, access is repeated each time.
(4) press the refresh button
No matter what the value is, it will be accessed again
When the Cache-control value is "no-cache", accessing this page does not leave page backup in the temporary article folder on the Internet.
In addition, specifying the "Expires" value also affects the cache. For example, if you specify the Expires value as a time that has passed, if you repeatedly press enter in the address bar when accessing this network, the access will be repeated at: Expires: Fri, 31 Dec 1999 16:00:00 GMT
For example, disable page caching in IE.
Http response message header settings:
CacheControl = no-cache
Pragma = no-cache
Expires =-1
Expires is a good stuff. if the webpage on the server changes frequently, set it to-1, indicating that it will expire immediately. If a webpage is updated at every day, you can set Expires to the next day.
When CacheControl = no-cache is specified on the HTTP1.1 server, the browser does not cache the webpage.
The Cache-Control title cannot be used for legacy HTTP 1.0 servers.
To be backward compatible with HTTP 1.0 servers, IE uses the Pragma: no-cache title to provide special support for HTTP.
If the client communicates with the server through a secure connection (https: //) and the server returns the Pragma: no-cache title in the response,
Internet Explorer does not cache this response. Note: Pragma: no-cache prevents caching only when used in secure connections. if used on a non-secure page, the processing method is the same as Expires:-1, this page will be cached but marked as expired immediately.
Cache-Control Message header domain description
Cache-Control specifies the Cache mechanism that requests and responses follow. Set in request message or response message
Cache-Control does not modify the Cache processing process of another message. The cache commands in the request include no-cache, no-store, max-age, max-stale, min-fresh, only-if-cached, commands in the response message include public, private, no-cache, no-store, no-transform, must-revalidate, proxy-revalidate, and max-age. The instructions in each message are as follows:
Public indicates that the response can be cached in any cache area.
Private indicates that the whole or part of the response message of a single user cannot be processed by the shared cache. This allows the server to only describe part of the user's response message, which is invalid for requests of other users.
No-cache indicates that the request or response message cannot be cached.
No-store is used to prevent the unintentional release of important information. Sending a request message does not cache the request and response messages.
Max-age indicates that the client can receive responses with a lifetime not greater than the specified time (in seconds.
Min-fresh indicates that the client can receive a response whose response time is earlier than the current time plus the specified time.
Max-stale indicates that the client can receive response messages beyond the timeout period. If the value of the max-stale message is specified, the client can receive response messages that exceed the timeout period.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.