$_SERVER[ 'PHP_SELF' ] gives you the path to the current script.
That lets you figure out which link to give the special class to. (personally, I do not like the link to be active at all).
PHP Code:
# array of arrays with LINK_TEXT and LINK_PATH
# add to array as site grows, etc
$pages = array(
array( 'Home' , '/index.php' ) ,
array( 'Links' , '/lynx.php' ),
array( 'Test' , '/phptest.php' )
) ;
$links = array() ;
foreach( $pages as $page ){
if( $page[1] == $_SERVER['PHP_SELF'] ){
$links[] = '<a href="' . $page[1] . '" class="current" >' . $page[0] . '</a>' ;
} else {
$links[] = '<a href="' . $page[1] . '" class="other" >' . $page[0] . '</a>' ;
}
}
# Now you can use $links to build your menu.