I have been working with PHP for a couple of years now but I don't consider myself any more than a moderate programmer.
While creating some websites (varying from presentation websites to some simple CMS'es), I have taken 2 approaches which I will discuss below. My question is simple: which one is better in terms of customization (it needs to be as customizable as possible) and speed (to load as fast as possible).
First choice
files: header.php , content1.php, content2.php , footer.php
idea: all the content files include the header at the beginning of the file and the footer at the end.
Second choice
files: index.php , content1.php, content2.php
idea: based on a GET variable or something similar, index.php includes the relevant php file
Thanks in advance for the answer!
I would go with the 2nd one. This is the approach taken by many frameworks and a very good one. You have a single place that get's always called, so you could do some processing in there like cleaning up the URL, checking for a valid Session,...
Furthermore, you can store some basic options inside the index.php (since it's a small site I see ne problem in this way of doing it but with bigger projects, sperate config files are the better way IMO) that can be accessed by all pages that are getting called (included) from within the index.php
file.
Speed should not be an issue with a small site so whatever solution you may choose in the end will have good results.