我正嘗試使用include_once()php api將文件(myfile.php)的內容加載到另一個(index.php)中。但它不會加載內容。 // contents inside index page
if(include_once('myfile.php')){
echo D; // this is working
echo $b; // this is not wo
我有2個PHP文件。 Connection.php:包含一個靜態函數,它將返回一個連接$con。 User.php:操作用戶的數據(數據庫),在其腳本中還需要Connection.php,以便它可以連接到數據庫。 然而,這會返回一個錯誤: Warning: require_once(./Connection.php): failed to open stream: No such file or