Learn to Create PHP Includes for Your Website

Dynamic Header Include


Header HTML



Header Include
  1. Cut out everything between the head tags in the html file, and paste into a new file, save it as header.php

  2. Change the page title in header.php to the php echo code to the left.

  3. Inside index.html, replace the head section with the php values for setting the page, and loading the header. Save this file as index.php. Complete this task for page.php, adding the page titles where they are called for.