Hi everyone I am new here. It has been a few years since I have done any php coding and need help.

My website is basically static and constant throughout the entire site except for the main content on the page. I know there is some way to use the PHP INCLUDES function so that when you click a link it will change the main content but not the whole page.

I found a thread on here of someone doing it but it does not explain how to use it.


If someone could please explain how to do this or send me somewhere that already explains it that would be much appreciated.


If you have a program that is working then imagine taking a section of that code, copying and removing it then being able to plug it back in from somewhere else. That is essentially what an Include / Require does. There are a variety of things that you can do with an Include. If you have parameters that are global to a system and you want to have available in every program, then you put them into a config module and include it everywhere. If you have headers and footers and other format bits that you want to include on every page, then you can use it for that as well. It is this latter usage that you are looking at.

This article may be useful as a starting point: