Php 不按URL

Php 不按URL,php,Php,这是我用来重定向的代码 当我按下URL时 获取结果 不按Id2=name的URL 谁能帮我解决这个问题 希望得到这个结果 很简单,您没有在URL中同时使用这两个id,只需按如下方式编辑它: header("Location: https://example1.com/away.php?to=https://example2.com/sample-page/?id1={$id1}&id2={$id2}", true, 301); 是否要忽略id2?您可以在代码

这是我用来重定向的代码


当我按下URL时

获取结果

不按Id2=name的URL

谁能帮我解决这个问题

希望得到这个结果


很简单,您没有在URL中同时使用这两个id,只需按如下方式编辑它:

header("Location: https://example1.com/away.php?to=https://example2.com/sample-page/?id1={$id1}&id2={$id2}", true, 301);

是否要忽略
id2
?您可以在代码开头取消设置它<代码>取消设置($_GET['id2'])我希望在按下url后可以执行id2。。按url后只执行id1而不是ID2这是否回答了您的问题?得到这个结果
header("Location: https://example1.com/away.php?to=https://example2.com/sample-page/?id1={$id1}&id2={$id2}", true, 301);