Home >Backend Development >PHP Problem >How to implement 302 jump in php
Jump method: 1. Use "header('HTTP/1.1 302 Moved Permanently'); header('Location: URL address');" statement; 2. Use "header('Location: URL' ,true,302)" statement.
The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
In php, you can use header() to Implement 302 jump.
Method 1:
header('HTTP/1.1 302 Moved Permanently'); header('Location: https://www.php.cn');
Method 2:
header('Location: https://www.php.cn', true, 302);
One more thing, if you want to adapt HTTPS/HTTP If so, this is enough:
header('Location: //www.php.cn', true, 302);
Recommended study: "PHP Video Tutorial"
The above is the detailed content of How to implement 302 jump in php. For more information, please follow other related articles on the PHP Chinese website!