Solution to form data loss after phphistory. back is returned, history. back_PHP tutorial

Source: Internet
Author: User
Tags php form
Solution to form data loss after phphistory. back is returned, history. back. Phphistory. solution to form data loss after return, history. backjs uses history. the main cause of data loss in the back returned form is the use of session_start ();, which is php history. solution to form data loss after return, history. back

Js uses history. back to return form data loss mainly because session_start (); is used. this function forces the current page not to be cached. This article introduces the solution to form data loss after php history. back is returned. For more information, see.

The solution is as follows:

Add header ("Cache-control: private") after your Session_start function. Note that your PHP program cannot have any output before this function.

In addition, the session-based solution is added before session_start.

Session_cache_limiter ('nocache'); // clear the form
Session_cache_limiter ('private'); // do not clear the form, only during the effective period of the session
Session_cache_limiter ('public'); // do not clear the form, as if the session is not used

Address: http://www.manongjc.com/article/823.html

Related reading:

Code for submitting the php $ _ PHP_SELF form to the current page

Solution to returning data loss after submitting a php form

Php uses JavaScript to submit a form to multiple pages

Submit the php form to the instance on the current page

Http://www.bkjia.com/PHPjc/1126526.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1126526.htmlTechArticlephp history. solution to form data loss after return, history. back js uses history. the main reason for data loss in the back returned form is that session_start (); is used. this function...

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.