This should produce the effect . . .
PHP Code:
//list of variables
$list_of_variables = array("var1" => "page one",
"var2" => "page two",
"var3" => "page three",
"var4" => "page four");
$tmp = array();
foreach ($list_of_variables as $var => $page_name) {
if ($_GET['my_var'] == $var) {
$tmp[] = "<font color='red'>$page_name</font>";
} else {
$tmp[] = "<a href='mypage.php?my_var=$var'>$page_name</a>";
}
}
echo(implode(" | ", $tmp);
echo("<br/>You've reached this page by clicking on ".$_GET['my_var']);
so then if the person clicks on
HTML Code:
<a href='mypage.php?my_var=var3'>page three</a>
they'll get this:
page one | page two | page three | page four
You've reached this page by clicking on var3
Where, of course, pages one two and four are links but page three is not.
Bookmarks