【发布时间】:2012-08-07 14:50:02
【问题描述】:
我有一个关于在 php 中格式化 URL 参数的问题
第1页可以有这2个url
http://somewhere.com/page1.php?foo=1
and
http://somewhere.com/page1.php
现在在第 1 页,当我单击一个按钮时,我希望它重定向到它自己,但在 URL 中添加一个额外的参数,就像这样
http://somewhere.com/page1.php?foo=1&bar=2
or
http://somewhere.com/page1.php?bar=2
取决于当前的网址。我如何在 php 中做到这一点?
谢谢, 维杜
【问题讨论】:
-
看看 print_r($_SERVER); 的输出
标签: php redirect get string-formatting