Home >Backend Development >PHP Tutorial >Problem returning to previous page in PHP

Problem returning to previous page in PHP

WBOY
WBOYOriginal
2016-07-29 09:15:442712browse

When submitting a form in PHP, if the requirements are not met, it will return to the previous page, but unlike ASP, the previously entered content will be retained, resulting in having to re-enter everything. I always thought that this might be the case with PHP. So I was lazy for a while and didn’t search for it. Today I saw a solution. It worked really well after I tried it. Haha, it seems I need to read more! The code is as follows:

session_cache_limiter('private, must-revalidate');

should be written at the top of the form page and added before session_start();. If session_start() is placed in conn, it is best to use this code Don't put them in the conn together, because when you return to other pages, they will not be refreshed.

Copyright Statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.

The above introduces the problem of returning to the previous page in PHP, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
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
Previous article:php array deduplicationNext article:php array deduplication