4 LIGHTENING YOUR WORKLOADWITH INCLUDES

What this chapter covers:

  • Using PHP includes for common page elements
  • Protecting sensitive information in include files
  • Automating a "you are here" menu link
  • Generating a page's title from its filename
  • Automatically updating a copyright notice
  • Displaying random images complete with captions
  • Using the error control operator
  • Using absolute pathnames with PHP includes

One of the great payoffs of using PHP is that it can save you a lot of repetitive work. Figure 4-1 shows how four elements of a static web page benefit from a little PHP magic.

image

Figure 4-1. Identifying elements of a static web page that ...

Get PHP Solutions: Dynamic Web Design Made Easy now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.