Get the App
SLTechnology News&Howtos  ›  Development  › 

How to set up php the page cannot be backed up

Shulou Source: shulou.com Published: 2022-06-03 15:25:40 09月29日 Update

This article mainly shows you "how to set up php page can not go back", the content is simple and easy to understand, organized clearly, I hope to help you solve doubts, let Xiaobian lead you to study and learn "how to set up php page can not go back" this article bar.

Php Set the page can not be backward method: 1, open the corresponding PHP page;2, by setting the code "header("Cache-control:no-cache,no-store, must-invalidate ");" to prohibit the page backward.

Operating environment: Windows 7, PHP 7.1, DELL G3

How does php set up pages that can't go backwards?

PHP header() Forbidden page back

The code is as follows:

header("Cache-control:no-cache,no-store,must-revalidate");header("Pragma:no-cache");header("Expires:0");header('Location:http://www.xxx.com');

Related Introduction:

The header() function sends the original HTTP header to the client.

It is important to realize that the header() function must be called before any actual output is sent (in PHP 4 and later, you can use output caching to solve this problem):

syntax

header(string,replace,http_response_code) The above is "php how to set the page can not go back" All the contents of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Tags: Pages content articles code functions learning help output original important actual customer client header method easy to understand more organization version environment Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info macOS Shulou Information Redmi Apple