所以我只是在学习PHP。我正在尝试运行我构建的登录脚本,但我收到了这个错误。
Warning: require_once(../../configs/db_config.php): failed to open stream: No such file or directory in C:\xampp\htdocs\test\assets\includes\logininc.php on line 4
Fatal error: require_once(): Failed opening required '../../configs/db_config.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\test\assets\includes\logininc.php on line 4
这是因为这条路径不正确吗?
此代码在页面上。
require_once "../../configs/db_config.php";
require_once "../../includes/memberfunc.php";
db_config 位于我运行的页面目录下的文件夹中(logininc.php)
更新:这是有问题的代码。它位于 index.php 旁边的基本目录中
<form id="login-form" method="post" action="assets/includes/logininc.php"> <fieldset>
<legend>Login </legend>
<p>Please enter your username and password to access the administrator's panel</p>
<label for="username"> <input type="text" name="username" id="username" />Username: </label> <label for="password"> <input type="password" name="password" id="password" />Password: </label> <label for="submit"> <input type="submit" name="submit" id="submit" value="Login" /> </label> </fieldset> </form>