Two files from different directory levels are simultaneously calling the same file:
// index.php
include('./include/same_file.php');
// Webpages/page1.php
include('../include/same_file.php');
// include/same_file.php
include('../template/header.php'); // failed to open on index.php
fopen('../files/text1.txt'); // failed to open on index.php
file('./files/AA.html'); // failed to open on /include/same_file.php
I have tried hours searching for solution and found the dirname(__FILE__)
and $_SERVER[DOCUMENT_ROOT]
solutions but none of them works because none of them are giving detailed teaching to a beginner like me.
try this..
or