donglanfu5831 2016-03-06 18:28
浏览 37

想要连续重定向302

Now i want to continuous redirect my site.

Example: Visitor go to: MyDomain/abc?id=1

They will be redirect 302 to: MyDomain/RandomString1

and continue Redirect to MyDomain/RandomString2

and continue:.... until to MyDomain/RandomString10

with Random string is random string and:

  • RandomString1 to 10 is not exist.

Please help me. Bellow attachment is demo Here is demo image

  • 写回答

1条回答 默认 最新

  • dousi6701 2016-03-06 18:39
    关注

    Not exactly sure what your looking for but as i understand the question this is what i have to offer

        <?
         $numberofstrings = 1;
         $i = $numberofstrings;
         $string = "url";
         
         while($i < $numberofstrings){
          $i++;
          $currentString = $string . "?id=" . $i;
          header("Location: $currentString")
         }
    $id = $_GET['id'];
    if($_GET['id'] == 1){
     header("Location: url");
    } elseif($id == 2){
     header("Location: url2");
    }
        ?>

    </div>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程