Lab 6
~/3680_S19/wk6/
With php you can easily create a consistent page layout and format style
across all your web pages. You simply generate your pages using php and
include the stylesheets and other components you want to appear on all
pages with server side include statements.
For this lab, you will create header.php, footer.php, nav.php, utils.php,
page1.php, and page2.php, style.css. Descriptions listed below:
- header.php - php file that you will require within your page1.php and
page2.php. The header.php file will contain doctype declaration, html, head,
title and link tags. Be sure to link your style.css. End the file with
the open body tag.
- footer.php - php file that will contain an html footer division,
a closing body tag, and a closing html tag. This script will require_once
utils.php to call displayDateAndTime function to print the current
date and time within the footer.
- nav.php - php file that will contain an unordered list of anchors
that will reference page1.php and page2.php. You may add more links or
pages if you desire.
- utils.php - php file that contains user defined functions and defined
constants. In this file you will write two functions: displayDateAndTime()
and another function of your choosing, I'll label as foo() for now.
displayDateAndTime() will echo the current date and time within the
footer section of the page, which utils.php will be required_once within
page1.php, page2.php, and footer.php. Your function foo() will be called
within the page1 and page2 content to demonstrate the function being
called.
- page1.php and page2.php - two seperate pages that will act as
the page construction scripts. These scripts will be somewhat the same, however
content of the two pages being different. Each page will require header.php,
nav.php, and footer.php. They will also requre_once utils.php. Fill
the content of the page such that page1 has different content than page2
- style.css - create some styling (simple or advanced) such that
your page1 and page2 layouts are identical. Each page should have
divisions for navigation, content, and footer.
Put all of these scripts into your
~/3680_S19/wk6/
depository
directory, which I'll extract and copy all of them at the time of the due
date.