【发布时间】:2016-03-25 12:26:17
【问题描述】:
我在操作后重定向页面时遇到了这个奇怪的问题。 仅当我想重定向到特定页面时才会发生这种情况。 我得到这样的当前网址
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
然后将其发送到我的操作文件中,如下所示:
lib/actions.php?module=shopping_cart&action=remove_item&removable_id=<?php echo $product_id;?>¤t_url=<?php echo $actual_link;?>
当在动作文件中收到时,我会像这样重定向:
Header("Location:$current_url");
它适用于 url 之类的:
http://localhost/restaurant/index.php?module=booking
或
http://localhost/restaurant/index.php?module=booking
但是当涉及到这个网址时:
http://localhost/restaurant/index.php?module=booking&action=dishes_selection
什么都没发生 即使我尝试回显 $current_url 它什么也没显示... 真令人沮丧:( 有人可以帮帮我吗 ??
【问题讨论】:
-
您是否尝试过回显 $_GET['current_url'] ?默认情况下,您需要从超级全局变量之一获取 url 参数,请参阅:php.net/manual/en/reserved.variables.request.php