PHP如何在父目录中的页面标题位置?

ale*_*cam 9 php directory location header

我有一个first.php页面

header("Location: script/script1.php")
Run Code Online (Sandbox Code Playgroud)

script1.php有另一个

header("Location: first.php") 
Run Code Online (Sandbox Code Playgroud)

但它显然给了我/script/first.php.有没有办法将其重定向到<root>/first.php而不是<root>/script/first.php

ark*_*cha 18

尝试这个:

header("Location: ../first.php")
Run Code Online (Sandbox Code Playgroud)

或者使用绝对路径或网址.

说明:..用于'父目录'的unix/linux表达式.互联网是unix土地,所以规则也适用于那里.