Home  >  Article  >  Backend Development  >  What should I do if the php header cannot be jumped?

What should I do if the php header cannot be jumped?

藏色散人
藏色散人Original
2020-08-27 09:53:334770browse

Solution to the problem that php header cannot jump: 1. Delete the space between location and ":"; 2. Cancel the output before "header('Location:'.$url);"; 3. Exit after the header; 4. Cancel the reset and jump conflicts of the htaccess file.

What should I do if the php header cannot be jumped?

Recommended: "PHP Video Tutorial"

PHP jump failed, header location is invalid

Solution

Check one by one:

0) There can be no space between location and ":"

1) Header('Location:'.$url); in front There cannot be any output, including various echoes, error reminders on the screen, and: various outputs of include files

2) The PHP code after the header will also be executed, so it needs to be after the header Exit

3) Check the reset and jump of the .htaccess file, don’t conflict

The above is the detailed content of What should I do if the php header cannot be jumped?. 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