Adding a Header and Footer - Exercise

Contact Us or call 1-877-932-8228
Adding a Header and Footer - Exercise

Adding a Header and Footer

Duration: 5 to 10 minutes.

In this exercise, you will add a header and a footer to a simple home page, which currently just contains a login form.

  1. Open ReusingCode/Exercises/Includes/Header.php and ReusingCode/Exercises/Includes/Footer.php in your editor and review the code.
  2. Open ReusingCode/Exercises/index.php in your editor.
  3. Add code to include ReusingCode/Exercises/Includes/Header.php and ReusingCode/Exercises/Includes/Footer.php at the top and bottom of the page.
  4. To test your solution, load ReusingCode/Exercises/index.php in the browser. It should display as follows:Require Output


<meta charset="UTF-8">
<title>Northwind Home Page</title>
<?php require 'Includes/Header.php'; ?>
<h1 align="center">Log in</h1>
<form method="post" action="Login.php">
<table align="center">
		<td><input type="text" name="Email" size="20"></td>
		<td><input type="password" name="Password" size="10"></td>
		<td colspan="2" align="right">
			<input type="submit" value="Login">
<?php require 'Includes/Footer.php'; ?>