1. Home
  2. Computing & Technology
  3. PHP / MySQL

Uniform Pages with PHP
Preform mass updates, or page makeovers easily!

By , About.com Guide

The Problem: Another year clicks by but you dread having to change the copyright date on all your pages... or that awesome design you made three years ago just doesn't look so awesome anymore. When your site was only five pages this wasn't really a problem, but it's grown so large that even small changes to all the pages are now quite time consuming

The Solution: Use the include tag to create a template for your page. This allows you to created shared headers, footers, or in-betweeners for your pages, where the content is all the same. Then you only have to update one file, and your new logo... or new copyright date, or new design will update on all your pages at once.

<?php include 'footer.php'; ?>
The above example demonstrates what you would put in your page to include a footer file. The file footer.php would then contain all the HTML (written normally) that you want to appear in the page footer.

Another Problem: This only works on PHP pages and all my pages are written in HTML. I'm listed in Google and can't change my page names now!

The Solution: It is possible to run PHP from an HTML page, if you follow this simple tutorial.

More PHP / MySQL Quick Tips
Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. PHP/MySQL Basics
  5. Uniform Pages HTML PHP - Update Pages PHP HTML - Headers Footers PHP HTML

©2009 About.com, a part of The New York Times Company.

All rights reserved.