Php > Complete Programs
Dynamic hyperlinked navigation bars
Dynamic hyperlinked navigation bars "/~dougal/test1.phtml", "Test Page 2" => "/~dougal/test2.phtml", "Test Page 3" => "/~dougal/test3.phtml" ); $separator = " | "; /* Put a vertical bar between links */ /* Main code begins here */ /* Step through the array.... */ for (reset($links_arr); $name = key($links_arr); next($links_arr)) { $hyper = 1; /* Hyperlink on by default */ /* * If the current page URI matches the current array element, * don't add the
stuff. Use the $hyper var to flag it. */ if ($REQUEST_URI == $links_arr[$name]) { $hyper = 0; /* Don't hyperlink a page to itself */ } /* Conditionally do the
part for hyperlinks */ if ($hyper) { print "
"; } print $name; /* Print the name of the link */ if ($hyper) { print "
"; } /* Close the hyperlink */ /* Do fancy tricks to print separators between links * The next/prev stuff keeps it from putting a trailing '|' * at the end of the list by testing to see if we are currently * looking at the last element of the $links_arr array. */ if (next($links_arr)) { print $separator; prev($links_arr); } } ?>
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage