对此我真的很困惑
我的文件结构为“新建”文件夹(项目)。请看下面的
New
|_Access(folder)
| |_function(folder)
| | |_abcd.php
| |_js(folder)
| |_css(folder)
| |_index.php
| |_store.php
|_js(Folder)
|_css(folder)
|_views(folder)
| |_header.php
| |_footer.php
|_crd(folder)
| |_dbconfig.php
|_index.php
|_tyou.php
|_ore.php
现在,我需要访问(\crd\dbconfig.php)
中的文件(\Access\store.php)
。
我该如何实现?
如果我在store.php中尝试require 'crd\dbconfig.php';
它会进入Access文件夹吗?或进入主文件夹?
由于我在访问文件夹中没有名为“ crd”的文件夹
答案 0 :(得分:0)
您必须使用require '../crd/dbconfig.php';
答案 1 :(得分:0)
我的建议:
You need to post dir location your main folder (NEW)
From index.php post dir location to store.php
OR
you put $dir_new = { YOUR NEW DIRECTORY };
In your db connection then use like this $dir_new."/yourfolder/yourfile.php"