PHP implementation of the page back to save the form content of two ways

Source: Internet
Author: User
In the development process, often because the form error and return to the page when the information is missing, in order to support page bounce, can be implemented by PHP two methods.

First, use the header method to set the message header Cache-control

Header (' Cache-control:private, Must-revalidate '); Support page Bounce

Second, use the Session_cache_limiter method
Session_cache_limiter (' Private, must-revalidate ');//note to be written before the Session_Start method

Ps:cache-control Message Header Field description
CACHE-CONTROL Specifies the caching mechanism that requests and responses follow. Setting Cache-control in a request message or response message does not modify the caching process in another message processing process. Cache directives on request include No-cache, No-store, Max-age, Max-stale, Min-fresh, only-if-cached, directives in response messages including public, private, No-cache, no- Store, No-transform, Must-revalidate, Proxy-revalidate, Max-age. The instructions in each message have the following meanings:

  • public indicates response Can be cached by any buffer.
  • Private indicates that the entire or partial response message for a single user cannot be shared with the cache. This allows the server to simply describe a partial response message for the user, and this response message is not valid for another user's request. The
  • No-cache indicates that the request or response message cannot be cached
  • No-store is used to prevent important information from being inadvertently published. Sending in the request message will make the request and response messages do not use the cache. The
  • max-age indicates that the client can receive a response that is not longer than the specified time (in seconds). The
  • Min-fresh indicates that the client can receive a response that is less than the current time plus a specified time. The
  • Max-stale indicates that the client can receive a response message that exceeds the timeout period. If you specify a value for the Max-stale message, the client can receive a response message that exceeds the specified value for the timeout period.
  • Above describes the PHP implementation of the page back to save the form content of the two methods, including the content, I hope to be interested in PHP tutorial friends helpful.

  • 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.