NavigationNavigation

  Main Menu

Home: Development: Php: Navigation: Breadcrumbs
Use this code to display a navigation menu.


/* 
 * Breadcrumbs, version 1.00 
 * This code is copyright (c) Peter Bowyer, and is released  
 * under the GNU general public license. Please leave this  
 * notice intact! 
 * This code was originally written for the F2S unofficial  
 * support site  
 *  
 * If you modify the code, please let me know.  I am always 
 * after improvements! Contact me at  
 *  
 */ 

// If your server doesn't support $HTTP_HOST variable, uncomment the lower 
// variable, and enter your site name.  Do not remove the trailing slash! 
$site = "http://".$HTTP_HOST."/"; 
// $site = "http://www.yoursite.com/"; 


//  If you are on a windows machine you may have to alter this line. 
$str = $PHP_SELF; 

ereg("^(.+)/.+\\..+$", $str, $part); 
$str = $part[1]; 
$str = substr($str, 1); 

// Define the names you want given to each of the directories 
$label =  array("test"=>"Test", 
                "faq"=>"FAQ/Tutorials", 
                "phorum"=>"Forums", 
                "links"=>"Links", 
                "asp2php"=>"ASP2PHP", 
                "whatsnew"=>"What's New", 
                "us"=>"Useful Stuff"); 



if (ereg("/", $str)){ 
$arr = split("/", $str); 
$num = count($arr); 
    for($i=0; $i < $num; ++$i){ 
    echo(" > ".$label[$arr[$i]].""); 
    $site = $site . $arr[$i] ."/"; 
    } 
}elseif (ereg("[a-zA-Z_]{1,}$",$str)){ 
$arr = $str; 
echo(" > ".$label[$arr].""); 
}else{ 
echo(""); 
}