NavigationNavigation

  Main Menu

Home: Development: Php: Navigation: Menu_include

PHP HTML Menu Include:

This function is good for an include to your pages where you want a menu with only the specified files listed. It shows the $text var, and links to the $file var.

# define the menu function
function menu($me, $file, $text) {
		if ($me == $file) {
		return "$text ";
	} else {
		return "$text";
	}
}

# Some servers have globals on and some off, so we make a 
# reference to $PHP_SELF here.
$me = basename($PHP_SELF);

# Define an array of teh files we want to list and 
# the text we want displayed
# file_name              Text Description
$choices = array("default.php" => "Home",
"about.php"           => "About DKE",
"fillins.php"         => "DKE Forms",
"treatment.php"       => "Treatment",
"permits.php"         => "Permits",
"wasteaccepted.php"   => "Wastes Accepted",
"customerservice.php" => "Customer Service",
"contact.php"         => "Contact us");


# Create output:
foreach ($choices as $file => $text) {
	echo menu($me, $file, $text);
}