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.