How to create the same Header and Footer on Separate web pages in PHP

By Prof. Fazal Rehman Shamil

How to create the same Header and Footer on Separate web pages in PHP

In this tutorial, you will learn how to create a header and footer in PHP.

In each page, we have to write the same code for our header and footer, so in this tutorial, you will learn how to make global header and footer files.

  • First, create a file named Index.php.
  • Then create a file named header.php and footer.php.
  • You have to include header and footer in the index file.

Code of index.php

Code of header.php

Code of footer.php

Output

headerfooterphp

Prof.Fazal Rehman Shamil (Available for Professional Discussions)
1. Message on Facebook page for discussions,
2. Video lectures on Youtube
3. Email is only for Advertisement/business enquiries.