PHP header(Location: …): Force URL change in address bar

后端 未结 14 1620
失恋的感觉
失恋的感觉 2020-11-28 08:10

I\'m currently working on a mobile site with authentication using PHP sessions with a database. I have a login page with a form that goes to server_login.php

14条回答
  •  自闭症患者
    2020-11-28 08:32

    I got a solution for you, Why dont you rather use Explode if your url is something like

    Url-> website.com/test/blog.php

    $StringExplo=explode("/",$_SERVER['REQUEST_URI']);
    $HeadTo=$StringExplo[0]."/Index.php";
    Header("Location: ".$HeadTo);
    

提交回复
热议问题