Home >Backend Development >PHP Problem >What to do if php fails to jump to the page

What to do if php fails to jump to the page

藏色散人
藏色散人Original
2021-03-19 09:47:243963browse

Solution to the failure of PHP to jump to the page: 1. Cancel the space between location and the ":" symbol; 2. Delete the output before "header('Location:'.$url);"; 3. , exit after the header; 4. Check and modify the reset and jump of the ".htaccess" file.

What to do if php fails to jump to the page

The operating environment of this article: Windows 7 system, PHP version 7.1, DELL G3 computer

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); There cannot be any output in front of it, including various echoes, error reminders on the screen, and: various outputs of include files

2) The PHP code after the header will still is executed, so you need to exit after the header

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

[Recommended: PHP video tutorial

The above is the detailed content of What to do if php fails to jump to the page. 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