如何在我的文件中包含目录??
我的文件夹就像这样
/require/connect_database.php
/ajax/anotherfolder/myfile.php
假设我在ajax
文件夹(ajax/anotherfolder/myfile.php
)
如何在/require
中的myfile.php
文件夹中添加文件?
我尝试过这样的事情,但它没有用。
** ** myfile.php
include '../require/connect_database.php';
答案 0 :(得分:0)
你似乎错过了一个../
。你有:
/ajax
/anotherfolder
/myfile.php
/require
/connect_database.php
要从ajax/anotherfolder/myfile.php
转到require/connect_database.php
,您需要:
include '../../require/connect_database.php';