Skip to content

Lecture Notes - Week 12


  • Chapters:
    • 24 - Adding a Navigation Menu
    • 25 - Adding Reservation Features: pgs. 379 - 406

Screencasts - Week 12

Outline of Topics

  • Adding page titles for every page that needs navigation
  • Creating a navmenu.php script
    • Adding a homepage icon
    • Adding logic for active pages
    • Adding logic for admin user
    • Adding logic for signed in and not signed in users
  • Update all pages using Navbar:
    • index.php, studentdetails.php, unauthorizedaccess.php, signup.php, login.php, addstudent.php, removestudent.php, editstudent.php


Let's finish up our Student Listing application by adding a navigation menu script that will be included by every page that needs navigation. We'll make the menu context sensitive based on whether a user is logged in or not, and if so, if they have administrative access or not.

Adding page titles to the pages that need navigation

Every page that includes the navigation menu will need to have a page title in order to add context sensitive logic for displaying the navigation menu. We have page titles for all of our scripts except two. Let's modify pagetitle.php to add page titles for index.php and studentdetails.php.

Creating a navmenu.php script

Next, let's create script called navmenu.php that can be included by all of these pages that provides a context sensitive navigation menu.

Updating all pages using the Navbar

Now that we have our navigation menu, we need to update the following files to use it:

  • index.php
  • studentdetails.php
  • unauthorizedaccess.php
  • signup.php
  • login.php
  • addstudent.php
  • removestudent.php
  • editstudent.php

Let's modify all these pages to use navmenu.php

Week 12 Lab