The example of this article describes the PHP use header jump failure solution, share for everyone for reference. The specific methods are analyzed as follows:
First, the question:
Today header (\ "Location: $url \"), the past jump always can, but today does not move, just the output, the past to confirm the check, $url the value is correct, so in the front with the Echo $url; The result is an invalid header function.
Second, the solution:
In PHP with the header ("location:test.php") to jump to pay attention to the following points:
1, location and ":" No space between, otherwise it will be wrong.//phpfensi.com
2, before using the header can not have any output, including the page of the include label "?>" cannot have a space.
3. The PHP code after the header will also be executed.
The header of PHP cannot have any content output before it jumps because PHP has sent the HTTP header information to the browser when it starts executing, and then it is no longer allowed to change.
However, if you have to process header information after the output, you can use Ob_start () Ob_end_flush () to cache the content you want to send, and wait until the header continues to send the content.
Or an easier way to modify php.ini, to find Output_buffering=off modified to output_buffering=4096.
I hope this article is helpful to everyone's PHP programming.