You are on page 1of 1

LAB

3A. Links with PHP in Website Layout




Assume that link to your website is: http://localhost/index.php

Assign links to buttons in Navigation bar (Horizontal Menu)

From previous layout, organize your buttons in horizontal navigation as:

Home Products Login Register


1. Assign links to above buttons as:
http://localhost/?page=home (URL 1)

è /localhost/index.php?page=home

http://localhost/?page=products (URL 2)
http://localhost/?page=login (URL 3)
http://localhost/?page=register (URL 4)

Make sure when you click on the links, some contents appear inside body section of
the web page interface.

When you click on URL 1, the browser loads home.php
Similar with URL 2 and URL 3, browser loads products.php and login.php

Note: You can include different files *.php inside the main interface, by using
include “filename.php”;

Expected outcome: you complete the file “index.php”

2. When you hover the button Products, it drops down a list of categories, you can click
on one of the categories
Hint: you can use CSS and/or JavaScript and/or bootstrap

Expected outcome: code showing navigation bar

You might also like