As we all know, PHP site jump has three kinds of methods: JS, HTML META-Refresh, PHP header ("Location: $url"). But here's a very small detail that can easily lead to errors.
One time to make a jump program, the result ignores this, resulting in the jump is actually no success.
Program all source code as follows, program address: http://www.***.com/go.php
<?php
error_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. This jump program was later copied to another website of the company, let QQ some friends test, the result many people say not open: IE kernel browser directly prompted inaccessible or can not find, chrome sometimes prompts to be reset or can't find, use Firefox test also occasionally will prompt can not find, But the refresh appears normal only once more.
Careful examination of the code is no problem. In addition, Firefox can jump, after thinking of the past to read the point is:IE browser if the output of the content byte is too small (less than 512 bytes), then it will be ignored . Then the source code by header location jump modified to JS HTML All browsers are tested through, the original even if the Firefox click Hint can not find the XXX server did not appear again, now go.php all source code:
<?php error_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 visitors can also jump if JS is disabled .
If you have a better way, welcome to reply or send me email to my email admin@zbphp.com.