What to do if php fails to jump to the page

藏色散人
Release: 2023-03-08 20:38:01
Original
3941 people have browsed it

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!

Related labels:
php
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template