Home Backend Development PHP Tutorial Solution to form data loss after php historyback returns krshistory history download history simple notation

Solution to form data loss after php historyback returns krshistory history download history simple notation

Jul 29, 2016 am 08:49 AM
history

The main reason why js uses history.back to return form data is because session_start(); is used. This function will force the current page not to be cached. This article introduces to coders the solution to the loss of form data after php history.back returns. Interested coders can refer to it.

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

There is also a session-based solution, add

session_cache_limiter('nocache');//Clear the form
session_cache_limiter('private'); //Do not clear the form, only while the session is in effect
session_cache_limiter( 'public'); //Do not clear the form, as if the session is not used

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

Related reading:

php $_PHP_SELF form is submitted to the current The code of the page

Solution to the loss of form data returned after the php form is submitted

php combined with js to implement the method of submitting the form to multiple pages

php form submission to the current page instance

The above introduces the solution to the loss of form data after php historyback returns, including the history aspect. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

11 Best PHP URL Shortener Scripts (Free and Premium) 11 Best PHP URL Shortener Scripts (Free and Premium) Mar 03, 2025 am 10:49 AM

11 Best PHP URL Shortener Scripts (Free and Premium)

Working with Flash Session Data in Laravel Working with Flash Session Data in Laravel Mar 12, 2025 pm 05:08 PM

Working with Flash Session Data in Laravel

Simplified HTTP Response Mocking in Laravel Tests Simplified HTTP Response Mocking in Laravel Tests Mar 12, 2025 pm 05:09 PM

Simplified HTTP Response Mocking in Laravel Tests

Introduction to the Instagram API Introduction to the Instagram API Mar 02, 2025 am 09:32 AM

Introduction to the Instagram API

Build a React App With a Laravel Back End: Part 2, React Build a React App With a Laravel Back End: Part 2, React Mar 04, 2025 am 09:33 AM

Build a React App With a Laravel Back End: Part 2, React

cURL in PHP: How to Use the PHP cURL Extension in REST APIs cURL in PHP: How to Use the PHP cURL Extension in REST APIs Mar 14, 2025 am 11:42 AM

cURL in PHP: How to Use the PHP cURL Extension in REST APIs

12 Best PHP Chat Scripts on CodeCanyon 12 Best PHP Chat Scripts on CodeCanyon Mar 13, 2025 pm 12:08 PM

12 Best PHP Chat Scripts on CodeCanyon

Announcement of 2025 PHP Situation Survey Announcement of 2025 PHP Situation Survey Mar 03, 2025 pm 04:20 PM

Announcement of 2025 PHP Situation Survey

See all articles