我想将子文件夹signup
中的登录页面重定向到主web
文件夹中的索引页面web
文件夹同时包含索引页面或signup
文件夹,login
页面在注册文件夹中。
我该怎么修?
header("Location: index.php");
根据HTTP规范,位置标头必须是一个绝对的URL,如下所示:
header("Location: http://example.com/index.php");
你也可以自动做到这一点:
header("Location: http://" . $_SERVER['SERVER_NAME'] . "/index.php");
我了解您的问题,那是一个由Login page
组成的注册文件夹,您希望从登录页面重定向到根文件夹header('location : ../index.php');