I have following directory structure for the project:
Home.php simply includes either of the two views i.e. login or invoice depending upon the session variables.
if (!isset($_SESSION['username'])) {
include 'views/login.php';
} else {
include 'views/invoice.php';
}
I include my constants file which contain database connection strings and other constants along with a autoloader file which register a autoload function to include all the classes.
include 'includes/constants.php';
include 'includes/autoloader.php';
It works without issues but when i use the same in get_data.php file it gives following error:
Warning: include(includes/constant.php): failed to open stream. No such file or directory.
Same error for autoloader.php too.