Today's header (quot; Location: $ urlquot;), the previous jump is always possible, but today it does not move, only the output results, in the past you have to confirm the check, $ whether the url value is obtained correctly, so echo $... is added before... today's header ("Location: $ url") is always available in the past, but it does not move today. it only outputs the result. in the past, you had to check whether the $ url value was obtained correctly, therefore, echo $ url is added before debugging, and the header function is invalid.
When using header ("location: test. PHP") in php to redirect, pay attention to the following points:
1. no space is allowed between location and:; otherwise, an error occurs. // phprm.com
2. there cannot be any output before using the header, including the "?>" tag on the include page" There cannot be spaces.
3. the PHP code after the header is executed.
No content can be output before the PHP header jump, because the HTTP header information has been sent to the browser at the beginning of PHP execution and cannot be changed.
However, if you have to process the header information after the output, you can use ob_start () ob_end_flush () to cache the content to be sent and wait until the header continues to send the content.
Or a simpler method is to modify php. ini and find output_buffering = Off and change it to output_buffering = 4096.
Permanent link:
Reprint at will! Include the article address.