【问题标题】:Going back one directory without wanting不情愿地返回一个目录
【发布时间】:2019-11-11 05:24:36
【问题描述】:

我正在与另一个人合作并且刚刚获得了他们的代码,当我尝试运行它时没有加载任何内容,因为所有文件名都将返回一个目录,例如 htdocs/dir/index.php 如果我在 php 中尝试 include_once('test.php') 它会出错,因为没有文件htdocs/test.php,写得不好见谅

【问题讨论】:

  • 你的问题是什么?
  • 请阅读how-to-ask并尝试生成minimal reproducible example
  • 如果 index.php 和 test.php 在同一个目录下,你可以试试include_once( __DIR__ . 'test.php');

标签: php html directory


【解决方案1】:

改用./test.php 修复它

【讨论】:

    猜你喜欢
    • 2011-10-11
    • 2021-08-20
    • 1970-01-01
    • 1970-01-01
    • 2015-08-24
    • 2011-08-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多