I'm working on a back office from scratch, and here are some folder examples
Admin > include > global_variable.php
Admin > sliders > variable.php
Admin > sliders > uploadfunction > index.php
In the index.php I have
<?php include('../variable.php'); ?>
And in the variable.php I have
<?php include('../include/global_variable.php');?>
However index.php is not reading the global_variable.php
It gives me the below error
"Warning: include(../include/global_variable.php): failed to open stream: No such file or directory in [irrelevant]\Admin\sliders\variable.php on line <i>1</i>"
No, this isn't an issue with forward-slash and back-slash, because it was working on a different architecture (I was linking ../variable.php and ../../include/global_variable.php on my index.php)
Logically this should work, however it's not. My assumption is that it is reading "../include/global_variable.php" from the directory of the index.php (which it should be reading from the variable.php)
Is there any workaround to it while keeping the same file structures?
Thank you