so, i'm making a website. let's say i have header.php, footer.php and
content.php.
now in index.php I simply want to include the 3 pages. easy enough to
do.
but let's say the user navigates to mysite.com/content.php. now the
header and footer will appear to be missing.
so now the question is, how can i include the header and footer in
content.php only if the page isn't already nested?
i suppose i can include a variable in header.php that basically says
"i've been included", and then in content.php if this variable isn't
set, i could include them... is this the best/most elegant approach?
content.php.
now in index.php I simply want to include the 3 pages. easy enough to
do.
but let's say the user navigates to mysite.com/content.php. now the
header and footer will appear to be missing.
so now the question is, how can i include the header and footer in
content.php only if the page isn't already nested?
i suppose i can include a variable in header.php that basically says
"i've been included", and then in content.php if this variable isn't
set, i could include them... is this the best/most elegant approach?
Comment