如何从header/ Zend_Registry取消设置post参数


How to unset post params from header/ Zend_Registry

是否可以从header或

中删除或取消设置post变量?
 Zend_Registry::get('request')

我试着做一个重定向,它在Chrome上工作,

  header("Location: /my_pages/page");
   exit(1);

  The page isn't redirecting properly
   Firefox has detected that the server is redirecting the request for 
   this address in a way that will never complete

Chrome可能看到了Firefox可能忽略的东西:

每次加载页面时都运行header(),这会导致循环。

在执行header()之前,您至少应该使用if()检查您希望取消设置的变量是否仍然存在。

if (isset($_POST["myVar"])) {
 header("Location: /my_pages/page");
 exit(1);
}

但是您是否尝试过首先使用普通的unset(),而不使用任何header()和其他东西?

unset($_POST['myVars']);
unset($_REQUEST['myVars']);

您可以使用下面指定的重定向
$ this -> _helper>转向器("action_name"、"controller_name");

把这个放到我想重载一次的页面的head标签中:

   <?php
    if (!isset($_GET['stop-reload'])) {
        echo '<meta http-equiv="refresh" content= "0;URL=?stop-reload=yes" />';
    }
    ?>

的值"mc"可以设置为任何你想要的,但两者必须在两行匹配。而"=test"可以是"=任何你想要的",它只需要一个值来停止刷新