Home >Backend Development >PHP Problem >What to do if php fails to jump to the page
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.
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!