I am trying to make a nav bar for a website. I have to use a foreach loop to display the different pages. However, whenever I try to display them they do not link the pages and they show the wrong text.. Here is the code:
<?php
//Main Navigation Function
function main_nav(){
$nav_sections = array("home"=>"","products"=>"products/","services"=>"services/",
"about"=>"about/", "contact"=>"contact/");
$output = "<UL>";
$i=0;
foreach($nav_sections as $nav){
$output .= "<LI><A href=" . URL_ROOT . $nav . "></A>" . $nav . "</LI>";
}
echo $output;
}
?>
URL_ROOT is a constant defined that gives the root URL, however it is not linking the pages through the text. This is what the site currently displays: http://tomcat.cit.iupui.edu/gaddough/cit21500/assignment4/
atag is empty...