<!DOCTYPE html>
<html lang="en">
<head>
<title>Web Programming using PHP - Coursework 2 - Task 1</title>
</head>
<body>
<header>
<h1>Web Programming using PHP - Coursework 2 - Task 1</h1>
</header>
<main>
<?php
$navLists = ['main'=>['home'=>'Home Page','study'=>'Study','research'=>'Research','sem'=>'Seminars'],
'study'=>['ug'=>'Undergraduate', 'pg'=>'Post Graduate', 'res'=>'Research Degrees'],
'research'=>['rStaff'=>'Staff','rProj'=>'Research Projects','rStu'=>'Research Students'],
'sem'=>['current'=>'Current Year','prev'=>'Previous Years'],
'ug'=>['cs'=>'Computer Science','ds'=>'Data Science'],
'pg'=>['swe'=>'Software Engineering','cf'=>'Computer Forensics']
];
?>
</main>
</body>
</html>
You are provided with a basic template index.php file, containing a two dimensional array, which should be
used to define the following NAV menu structure from the Department of Computer Science Intranet:
- Home
- Study
2.1. Undergraduate
2.1.1. Computer Science
2.1.2. Data Science
2.2. Post Graduate
2.2.1. Software Engineering
2.2.2. Computer Forensics
2.3. Research Degrees - Research
3.1. Staff
3.2. Research Projects
3.3. Research Students - Seminars
4.1. Current Year
4.2. Previous Years
You are required to create a PHP application which uses the given data array to display the main menu and
any sub menu that is related to a parent menu item. If a menu item is selected then you should display the
selected item underneath the menus. The desired interaction can be seen by clicking on the following link;
click here to see a working example.
You application should conform to the following requirements:
- Your solution should be coded in PHP only between tags in the index.php file. No JavaScript,
or CSS is to be used to implement the solution and you should write re-usable user defined functions to
generate the required HTLM (headings, paragraphs, NAV and hyperlinks. - You should use URL parameters to determine which NAV menu is currently active and which item has
been selected by the user. - On initial load of the application the ‘main’ NAV menu should be displayed with no item selected.
- The ‘main’ NAV menu should always be permanently displayed.
- If an item from a NAV menu is selected, which has an associated sub NAV menu, then the associated
sub NAV menu should also be displayed on the line below the ‘selected NAV link. - If an item is selected from a sub NAV menu, then the same sub NAV menu shoud remain displayed.
- You should display the text of any item selected by the user underneath the NAV menus as a HTML
element.
8. Your PHP code should generate NAV menu’s using elements and links
only (UL and LI elements should not be used).
i am not getting it correctly anyone help me plz
Muhammad Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.