<?PHP
//establish page level and assign it $levels
/* The next line has been a pain
in my rear... you may need to play with it to
make it work on your particular system. I've
tried to include some of the things that
have worked for me */
//for Apache on Win, uncomment next line
//$URL_vars=explode("/",$REQUEST_URI);
//for IIS as ISAPI module on Win, uncomment next line
//$URL_vars=explode("/",$URL);
//for IIS as CGI on Win, uncomment next line
//$URL_vars=explode("\\",$PATH_TRANSLATED);
$URL_parts=sizeof($URL_vars);
/*IMPORTANT You may need to change the number below depending on the real depth of your root directory*/
$URL_parts=$URL_parts-2;
$levels=""; $i=1;
if($i<$URL_parts) {
while($i < $URL_parts) {
$levels.="../";
$i++;
}
}
//array for global web site links
//pairs are: directory => department name
//CASE SENSATIVE - upper case proceeds lower case
$arr_links = array('dept1/' => 'Department 1',
'dept5/' => 'Department 5',
'dept6/' => 'Department 6',
'dept4/' => 'Department 4',
'dept2/' => 'Department 2',
'dept3/' => 'Department 6');
//alphabetize array by department name
asort($arr_links);
//make the list of links
//the '/' in the break tag is an XHTML convention
while ( list($key, $val) = each($arr_links) ) {
echo "<A href="$levels$key">$val</A><br />n";
} ?>
|
|