PHP:使用URL参数打印'<meta http-equiv ="refresh"content ="0; url ='

seh*_*mel 4 php

如何使用URL参数创建此字符串?我想要的是:

print '<meta http-equiv="refresh" content="0;url=http://domain.com?a=1&b=2">';
Run Code Online (Sandbox Code Playgroud)

但这并没有正确传递我的第二个参数.我得到一个")"而不是b.我究竟做错了什么?

我试过&amp;而不是&符号,但这也不起作用,

小智 7

echo "<meta http-equiv='refresh' content='0;url=http://domain.com?a=1&b=2'>";
Run Code Online (Sandbox Code Playgroud)

甚至

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

因为你使用0作为延迟

  • 使用POST数据,标题非常好; 重定向后推送刷新不会导致重新提交.这就是POST-REDIRECT-GET模式如此受欢迎的原因. (2认同)