Home  >  Article  >  Backend Development  >  How to implement 302 jump in php

How to implement 302 jump in php

青灯夜游
青灯夜游Original
2021-09-16 19:36:167348browse

Jump method: 1. Use "header('HTTP/1.1 302 Moved Permanently'); header('Location: URL address');" statement; 2. Use "header('Location: URL' ,true,302)" statement.

How to implement 302 jump in php

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!

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