php include_once没有按预期工作

时间:2014-01-27 10:58:51

标签: php

结构:

=root=
authcheck.php
index.php

==root/includes==
authcheck.php   [ only has include_once '../authcheck.php'; ]
page1.php
page2.php

从index.php我包括includes / page1.php和page2.php .. 这两个phps包括文件夹include_once authcheck.php。

我在include中使用authcheck.php只是因为,如果我将文件夹移到另一个文件夹,我只需将../authcheck.php更改为../../authcheck.php

我的问题是这种方法include_once不起作用。但是在调用index.php时它给出了错误。错误说不能重新声明函数foo(在authcheck中)。

需要帮助。

0 个答案:

没有答案
相关问题