PHP-Javascript: "back to previous page" has no cache problem. Read the PHP-Javascript "back to previous page" and there is no cache problem. Hello, welcome to visit this site. If this is your first visit to this site, you are welcome to subscribe to the RSS of this site and get the latest information on this site at any time. RSS: http://feed.photozero.net many friends who use PHP to write scripts will encounter this problem, than "> <LIN
Hello, you are welcome to visit this site. If this is your first visit to this site, you are welcome to subscribe to the RSS of this site and get the latest information on this site at any time. RSS: http://feed.photozero.net
Many users who use PHP to write scripts will encounter such problems, such as a registration page (without any AJAX), entering account and password information, and then entering the information, they need to go to the server for verification, if the verification fails, you need to ask the user to fill in the information again. This is a great headache for many users, and may be the result of dropping the registration. There are several solutions to this problem:
1. still call the page, output the error prompt, andChange the value of value to the value entered by the user just now. This should be the best method, but the disadvantage is thatThe VALUE.
2. There are still many lazy people, like me, who can directly output an error prompt page when verification fails and add JavaScript code to the page:
Return
Or
Return
This code returns the code of the previous page. After the code is returned, all data except the password type will be kept on the webpage, which is friendly.
However, when many of my friends use JS to return data, there is no data cache on the webpage, but sometimes there are some, which is really confusing. A few days ago, I also encountered this problem during development. I had to start with my own code analysis after I had failed to get online with Google for a long time. At this time, session_start (); caught my attention. Session_start (); is the function used to enable the $ _ SESSION. After the SESSION is enabled, it seems that every time you access a webpage, you have to call the webpage again. After I remove this sentence, the problem will be solved. If the webpage data cannot be cached, try removing the SESSION.