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

藏色散人
Release: 2023-03-05 09:58:02
Original
4760 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!