我有这样的文件夹结构:
|Home
|____|Admin
|__________|Pages
|
|
|db_config.php
位于主目录中的文件,我将连接设置为db_config.php文件,如下所示:include("db_config.php");
对于位于pages目录中的文件,我设置为:
include("..\\..\\db_config.php");
这个设置在我的本地工作正常,当我将我的网站上传到000webhost时不起作用。我该怎么做才能解决这个问题?谢谢
简单地改变
include("..\..\db_config.php");
至
include("../../db_config.php");
\只适用于Windows,Linux使用/(您的主机可能正在使用)BTW,总是使用/,Windows也接受它。