Best site structure/architecture for simple php site
Posted: Sat Jul 01, 2006 5:50 pm
I have a static html website with about 20 pages. Just about every page has the exact same html on it with only the content differing on each page. I would like to convert my site to a php based solution so that I can minimize the amount of repeated code on my site and make maintenance and updates easier.
What I would like to know, is there a best practice way to do this? In my search I have come across countless methods, but none seems to stand out, either in my eyes or the eyes of the php community, as being the ideal way to do things.
Two common variations seem to be:
What I would like to know, is there a best practice way to do this? In my search I have come across countless methods, but none seems to stand out, either in my eyes or the eyes of the php community, as being the ideal way to do things.
Two common variations seem to be:
- Have a single index.php page which processes $_GET variables. In this situation, the user visits the template file and the template pulls in the unique content. Users access the site by typing in URLs such as: http://www.domain.com/index.php?p=somepage.
- Have many unique content pages which include a header/footer or an entire template. In this situation, the user visits the unique content page and the unique content page pulls in the template. Users access the site by typing in URLs such as: http://www.domain.com/somepage.php