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.


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 live online training, plus books, videos, and digital content from nearly 200 publishers.