You are seeing this very light version of the page, as you are using an outdated browser!

Onlinetools.org is done in XHTML 1.0 and supports CSS 2.0, please upgrade your browser if you want a better version of this site.

Thank you, please help us developers keep up with the industry rather than patching our code for outdated applications.

open or close right navigation

Flexible navigation with PHP

Advertisement:
 
written by:Christian Heilmann on 26.04.2002
Jump to page: 1  2  3  4  5  or read all on one page
 

How to gain flexibility

How to make the navigation flexible?

It is actually pretty easy. All you need to have is a list of all the pages you want in your navigation, and a mean of knowing which one you are visiting right now.

The display of the page you are on should be highlighted, the others should be links.

Keep your navigation in one file and include it into every page.

To tell the script which page you are on right now, you use the $HTTP_SERVER_VARS['REQUEST_URI'] variable of PHP.

This variable displays the whole path of the document, you are right now looking at.

This is something you can tweak a bit and compare to your list of pages. You should set up all your pages the same way, as a template. Let's take a look at an example of a template

more»
Table of contents:

The navigation woe
How to gain flexibility
The page template.
The nav.php script
Download and known issues

Back to top

Search:

 

Font:

Click to decrease fontsizeClick to increase fontsize

Text-colour:


Background:


sponsored by :

NWU

Help Onlinetools.org

Help onlinetools.org, donate via paypal

Partners

easyPHP

icons

Link to us

copy the code here:


Powered by EasyCMS