开发者

PHP: print '<meta http-equiv="refresh" content="0;url=' with URL parameters

How do I create this string with URL parameters? Wh开发者_StackOverflow中文版at I want is something like:

print '<meta http-equiv="refresh" content="0;url=http://domain.com?a=1&b=2">';

But that doesn't pass my second parameter correctly. I get a ")" instead of a b. What am I doing wrong?

I've tried &amp; instead of the ampersand, but that doesn't work either,


echo "<meta http-equiv='refresh' content='0;url=http://domain.com?a=1&b=2'>";

or even

header ("Location: url=http://domain.com?a=1&b=2");

since you are using 0 as delay


If you're already using 0 delay for the <meta> refresh, why don't you just use a HTTP Location redirect?

<?php
   header('Location: http://domain.com?a=1&b=1');

and if it's in the middle of a page you have to rewrite your program to make it SENSIBLE


Why shouldn't you code work? Cause it does work...

If I run your code I go to:

domain.com?a=1&b=2


print "<meta http-equiv='refresh' content='0;url=http://domain.com?a=1&b=2'>";

there are differences between ' and "

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜