PHP-Javascript "back to previous page" without caching Problems

Source: Internet
Author: User
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.

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.