require索引

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:56:03
Original
967 people have browsed it

require目录
osadmin的目录如下

注意
index.php在uploads目录下,
init.inc.php在uploads/include目录下
config.inc.php在uploads/include/config目录下

index.php:
require ('./include/init.inc.php');

init.inc.php:
require 'config/config.inc.php';

按理说访问index.php页时,寻找config.inc.php页的路径应为uploads/config/config.inc.php,是一个错误路径,但为什么实际运行确能找到?各位能解释下是怎么找到的吗。

难道解析这种既不是绝对路径,又不是相对路径的的路径,还有什么基情。

(补充)include_path:‘.;C:\php\pear’
------解决方案--------------------
init.inc.php:
require 'config/config.inc.php';

init.inc.php里面不是包括了config.inc.php 么,当然能找到啦。
------解决方案--------------------
require 'config/config.inc.php';
不是在 init.inc.php 中执行的吗?
所以既然只有 uploads/include/config/config.inc.php 存在,当然就加载他了

你#2的描述是正确的
如果你有 uploads/config/config.inc.php 文件,那么这个文件将被优先加载
也就是说,你可以用这种方法干预应用系统的行为

------解决方案--------------------
是的,是这样的

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template