【发布时间】:2012-05-03 23:40:25
【问题描述】:
我很困惑在 include 中编写路径。
这里有一些细节
我有一个文件 index.php 在这里:
localhost/widget/explore/staff/index.php
并希望在此处包含一个名为 constants.php 的文件:
localhost/widget/includes/constants.php
告诉我需要的路径怎么写
include '?';
【问题讨论】:
-
您是在尝试使用
include()PHP 的核心功能还是在谈论include_pathPHP 配置选项? -
@webbandit 从技术上讲,
include是一个预处理器指令,而不是一个函数,这就是为什么我更喜欢它不带括号,OP 的编写方式:-] -
警告:require_once(connection.php) [function.require-once]:无法打开流:C:\Users\Yousuf\Desktop\Web\localhost\widget_corp\ 中没有这样的文件或目录explore\staff\index.php 第 6 行
-
仍然报错 grrr
-
现在它的工作认为每个人都特别感谢您的帮助