in my main directory on the server ive got a bunch of files that use includes to create a page header. the header itself includes information from several subdirectories, like "/images", "/css", "/includes", etc.
so now i want to have a page in a different directory use that same header. so i made a file with only the header data in it (in the main directory) so i could call it from somewhere else, like so:
but when i do that all the includes within "header_only.php" no longer work because they are seeing a different folder as the starting point.
so basically ive got a file that "includes" material from subdirectories, but the includes get lost if i include that main file from another location.
im sure this is a pretty common issue... what is the easiest way to get around this without duplicating code?
so now i want to have a page in a different directory use that same header. so i made a file with only the header data in it (in the main directory) so i could call it from somewhere else, like so:
Code:
include('../header_only.php');
but when i do that all the includes within "header_only.php" no longer work because they are seeing a different folder as the starting point.
so basically ive got a file that "includes" material from subdirectories, but the includes get lost if i include that main file from another location.
im sure this is a pretty common issue... what is the easiest way to get around this without duplicating code?