Sites of Endlessrage About Endlessrage Affiliates

PHP Includes
If you're maintaining a website and still manually edit every single page when you make a layout change, you are deserving of dropkick from me. There is an easier way to maintain your website without editing everything every time you change the layout. This method is known as PHP Includes. Now like me, you do not have to know anything about PHP. You can just pass your pages off as PHP while still having everything in it being written in HTML.

First off you need to find which Directory of your site that you'll be implementing php includes. Once you do create the following two files:

1. header.php
2. footer.php

In header.php, this is where you put your opening tags. In footer.php, this is where you put your closing tag.

Now to get this to work...

Create a new test file. It has to be a php file and not html, shtml, or whatever. In that file, include this at the top:

<? include('header.php'); ?>

And include this at the bottom:

<? include('footer.php'); ?>

The content of the page will be included between header and footer in the page. Write some jibberish and save.



If you did this correctly, this page should have the layout without all the stinky layout codes in it. To apply the layout everywhere else, just follow the same steps you did now. Include the include codes in each page.

Now, every time you need to make a layout change, you simply edit the header.php and footer.php pages. All changes to those will automatically apply to the rest of the site. If they have the php includes in them, of course.

This has saved me a lot of time and made my life a lot easier.