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 &
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 "
精彩评论