加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

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

发布时间:2020-12-13 18:24:13 所属栏目:PHP教程 来源:网络整理
导读:我有一个first.php页面 header("Location: script/script1.php") 和script1.php有另一个 header("Location: first.php") 但它显然向我发送了/script/first.php. 有没有办法将它重定向到 root /first.php而不是 root /script/first.php? 尝试这个: header("
我有一个first.php页面
header("Location: script/script1.php")

和script1.php有另一个

header("Location: first.php")

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

尝试这个:
header("Location: ../first.php")

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

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读