|
The sites that do site.com/index.php?page=about get their content from a database. This allows more room on the server for actual files, so instead of creating a file for each page, they input the content on that page into a MySQL database and then use the site.com/index.php?page=about method. This is useful if you have tons of pages or content.
To do what you're wanting to do, you need to create a php file with the code in it you want (for example footer or navigation). Then in every page you want that file to appear, use the php include function to include that php file. For example:
I create a footer.php file with the copyright info, styling, etc. Then in index.php, about.php, and contact.php at the bottom of the page I put this line: <? include("footer.php"); ?>
That will display the code of footer.php in every page that you put the above line of code. Then if you want to edit your footer, you just have to edit footer.php and it will update on all pages.
|