Is there a way so that I could put an include() at the top of each of my pages so that it will include a header and footer? Like this:
include("/file/blah/blah/directory/anotherdirectory/header.php");
which would include:
---------------------------
<div>
blah blah blah stuff
</div>
..
include("/blah/files/place/directory/footer.php");
---------------------------
So the header included file would have the top, have some sort of code (in this case, "..") which tells it to display whatever else from the page that's requesting the include(), and then after that, include the footer file data?
include() bottom with top
Moderator: General Moderators
-
skullmunky
- Forum Newbie
- Posts: 12
- Joined: Fri Apr 17, 2009 10:25 pm
Re: include() bottom with top
I don't think so ... if include is like include in C, it just writes everything in the included file directly in. when file A includes B, B has no way of knowing anything about A. So you'd have to include header.php and footer.php individually at the appropriate place in the file.