为什么这个脚本在Firefox中工作但在IE9中不工作?

时间:2012-02-14 10:30:40

标签: php firefox internet-explorer-9

$URL="http://www.villagestone.co.za/mailsendfail.html";
print "<meta http-equiv=\"refresh\" content=\"1;$URL\">";

3 个答案:

答案 0 :(得分:2)

啊,现在我明白了。试试这个:

$URL = "http://www.villagestone.co.za/mailsendfail.html";
print "<meta http-equiv=\"refresh\" content=\"1;URL=$URL\">";

IE期望'URL ='前缀,这就是它在Firefox而不是IE中的原因。

答案 1 :(得分:0)

最好通过header功能重定向

header('Location: '.$URL);

注意:此行必须在输出任何文本之前出现。

阅读更多:http://php.about.com/od/learnphp/ht/phpredirection.htm

答案 2 :(得分:0)

如果您有干净的字符串,最好使用''喜欢:

$URL = 'http://www.villagestone.co.za/mailsendfail.html';
print '<meta http-equiv="refresh" content="1;url=' . $URL . '">';
相关问题