我正在建立一个网站,我必须访问核心文件夹中的init文件。我目前在包含文件夹detailsmodal.php
文件中,该文件由onclick事件触发。我使用的路径
require_once './core/init.php';
当我点击模态时出错:
警告:require_once(./ core / init.php):无法打开流:第2行的C:\ xampp \ htdocs \ mednew \ includes \ detailsmodal.php中没有此类文件或目录
致命错误:require_once():在C:\ xampp \ htdocs \ mednew \ includes \ detailsmodal.php上打开所需的'./core/init.php'(include_path ='C:\ xampp \ php \ PEAR')失败2
require_once('../../core/init.php');
我认为你前面有两个目录而不是一个。