Actually that is exactly the way WordPress does it. The index.php page of WordPress generally looks like this: first < ?php get_header(); ?>, then it gets all the main content using the loop, after that it sometimes gets a sidebar and it ends with < ?php get_footer(); ?>.
So I’d say your code above is pretty much the same, of course if you don’t want the footer or header in one of your pages you just don’t put for example < ?php get_header(); ?>in your code.
Be sure to add the and closing tags to your footer file though.
and i HATED this way because i didn’t like the fact that i had to echo the entire page including images and everything. aldo the code highlighting in my text editor was one color which made everything confussing. so i wasn’t sure what to do but the way im doing it. so thats why now im looking at a different way. i can see that im not doing anything wrong. but would like to figure out how to loop in pages so i dont have to put include header and include footer on every page. because i would like to add a blog (write it myself) one day down the road. and probibally some sort of CMS myself for my site. but thats LAATERR down the road for the entire site.
Just out of curiosity – why don’t you just use WordPress? The way I see it, it fits your needs exactly, because as you say, it’s a hassle the way you get and include everything now. Using WordPress you can just use WordPress’ functions and that seems a lot easier than you’re doing it now.
The first post above was just an example. my site does have it.
i used to use wordpress, but when i installed it and set everything up. honestly i didn’t know what I was looking at, and the snippets in PHP for CSS-Tricks, i didn’t know what was going on and how to implement them . now that im learning php more im getting around easier. but would like to be able to learn the functions id like in an example i can relate to. to be able to use it. like i dont need a blog now, and just want these static pages.