为什么我在该代码上获得ERR_TOO_MANY_REDIRECTS

时间:2017-11-11 12:08:38

标签: php redirect submit token form-submit

不是每次,浏览器chrome,firefox,iexplorer都会返回错误重定向并且它们会被卡住(我需要删除cookie) 在那段代码中:

session_start();
if(isset($_POST['submit'])){
    $_SESSION['submit']=true;
}

if (isset($_POST['submit']) || ( isset($_SESSION['submit']) && $_SESSION['submit'])) {
   if($_SESSION['user_token'] == $_POST['user_token']) {
       if (isset($_POST['submit1'])) {
            unset($_SESSION['user_token']);
                $_SESSION['submit']=false;
                include_once('./token.php');
                include_once('./my3page.php');
       }
       include_once('./my2page.php'); //**PAGE WITH BUTTON NAMED SUBMIT1**
   } else {
      header("location: ./index.php");
   }
} else {
    include_once('./token.php');
    include_once('./my1page.php'); //**PAGE WITH BUTTON NAMED SUBMIT**
}

为了重现错误,其中一种方法只按SUBMIT按钮而不输入任何内容(my1page包含搜索表单)

0 个答案:

没有答案