Chapter 4. Lightening Your Workload with Includes

Lightening Your Workload with Includes

The ability to include the contents of one file inside another is one of the most powerful features of PHP. It's also one of the easiest to implement.

Most pages in a website share common elements, such as a header, footer, and navigation menu. You can alter the look of those elements throughout the site by changing the style rules in an external style sheet. But CSS has only limited ability to change the content of page elements. If you want to add a new item to your menu, you need to edit the HTML in every page that displays it. Web authoring tools, such as Dreamweaver and Expression Web, have templating ...

Get PHP Solutions: Dynamic Web Design Made Easy, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.