First, the question:
Today header ("Location: $url"), the previous jump can always be, today is not moving, just output results, the past to confirm the check, $url the value of the correct, so in front of the echo $url; The result is an invalid header function.
Second, the solution:
In PHP, use header ("location:test.php") to jump to note the following points:
1, location and ":" No space between the number, or there will be errors.//downcc.com
2, before using header can not have any output, including included in the page labeled "?>" can not have spaces.
3, after the header of the PHP code will also be executed.
PHP header jump can not have any content output before, because PHP began to execute the browser has sent HTTP header information, and then no longer allow changes.
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, until the header continues to send the content.
Or a simpler way to modify php.ini, find Output_buffering=off modified to output_buffering=4096.
I hope this article will help you with your PHP program design.