PHP historyback return form data loss solution krshistory history Download Simplified

Source: Internet
Author: User
The main reason that JS uses History.back to return form data loss is the use of session_start (), which forces the current page not to be cached. This article to the code Farm introduction of PHP history.back return form data loss solution, interested in the code farmers can refer to.

The solution is as follows:

Add the header ("Cache-control:private") after your session_start function; Note that your PHP program cannot have any output before the bank.

There are also session-based solutions, which are preceded by a session_start

Session_cache_limiter (' NoCache ');//emptying the form
Session_cache_limiter (' private '); Do not clear the form until the session is in effect
Session_cache_limiter (' public '); Do not empty the form as if you did not use the session

Original address: http://www.manongjc.com/article/823.html

Related reading:

Code submitted by PHP $_php_self form to the current page

Workaround for returning form data loss after PHP form submission

PHP combined with JS implementation of forms submitted to multiple pages of the method

Submit a PHP form to the current page instance

The above describes the PHP historyback return after the form of data loss solution, including the history of 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.