As we all know, PHP website jumps three ways: JS, HTML META Refresh, PHP header ("Location: $url"). But here is a very small detail that can easily lead to errors.
Header ("Location:test. PHP ") Jump success in addition to note the following three points there is a prerequisite must be noted:
1, location and ":" No space between, otherwise it will be wrong.
2, before using the header can not have any output.
3. The PHP code after the header will also be executed.
The premise is that your editor is written in UTF-8 without BOM format, not in UTF-8 format. Remember!
Once made a jump program, the results ignored this point, resulting in the jump is actually not successful.
Program all source code as follows, program address: http://www.***.com/go.php
<?phperror_reporting (7); $url = UrlDecode (Trim ($_request[' url ")), if ($url) { header (" Location: $url ");} else { exit (' Error input,<a href= ' http://www.***.com/?f=go.php ' >go back</a> ');}
When the access address is: http://www.***.com/go.php?url=http%3a%2f%2fwww.zbphp.com%2f, the Firefox browser is normal. Later this jump program copied to the company's other website, so that some friends on the QQ test, the result many people say that cannot open: IE kernel browser direct prompt cannot access or find, chrome sometimes prompts to be reset or cannot find, use the Firefox test also even occasionally hint can't find, But it only shows up once more.
Check the code carefully, there is no problem. Moreover, Firefox can jump, after thinking of the previous reading is: IE browser if the output bytes are too small (less than 512 bytes), then the
<?phperror_reporting (7); function Gheader ($url) {echo '
For PHP jumps, I think the best way is to use js+html META . HTML Meta can ensure that a visitor can jump to the same condition if JS is disabled .