Hello,
Here is my script:
Code: Select all
<?php
function foLinks($link)
{
//$pages pops an array with links set by webmaster
$pages = array (
"Interactive" => "folio.php?display=interactive",
"3D" => "folio.php?display=3d"
);//Add the links here
//$pages pops an array with link-related titles set by webmaster
$titles = array (
"Interactive" => "→ ambiguism ← {Interactive]",
"3D" => "→ ambiguism ← {3D]"
); //Add the titles here
$my_title = $titles[$link];
//Use $test to add $pages[$link] to $page for comparison:
$test = str_replace("folio.php", "", $pages[$link]);
//remove /'s and replace with ""
$page = str_replace("/", "", $_SERVER['SCRIPT_NAME']).$test;
//Compare URL to links for display of current and non-current nav links:
//If page is current, set the link to "#" and set CSS class to "current"
if($page == $pages[$link]) {
echo " <span class="arrow">«</span><a href="#" class="current" title="$my_title">$link</a>";
} else {//set to non-current style
echo " <span class="arrow">»</span><a href="$pages[$link]" title="$my_title">$link</a>";
}
}
//This next linke displays the links on the page:
foLinks("Interactive");
echo "<br />";
foLinks("3D");
?>Could someone help me with this one? I am having troubles seeing my logic error(s).
Thanks in advance, I really appreciate any help anyone can give me. :)
Cheers!
Micky