|
Posted by Martien van Wanrooij on 04/17/06 17:12
Hi all,
In order to avoid that in a menu bar a link that is already active, still
can be clicked I use the following function
function maakZoNodigLink($omschrijving, $verwijzing, $separator = "<br>\n")
{
$locatie = $_SERVER['PHP_SELF'];
if (strstr($locatie, $verwijzing)) //link to the
current page so no need to make it clickable
echo $omschrijving."$separator";
else echo ("<a class = \"menu\" href =
\"$verwijzing\">$omschrijving</a>$separator"); //a real link so it has to be
clickable
}
It works okay but I would like to make something similar when there are some
parameters involved like www.mysite.nl/mypage.php?item=3
an example is www.tapperijbeekendonk.nl where some pages are just separate
php files, however some activities are retrieved from a mysql database and
handled by a page called agenda.php . I would like that, when the
"Koninginnedag" page is active, the "Koninginnedag" link is not clickable. I
tried to find out in Google and in several php manuals how to retrieve both
the url and the part behind it (which starts with the question mark) I guess
it is one of the elements of the $_SERVER - array but unfortunately I
couldn't find it up to now.
Thanks for any help.
Martien.
Navigation:
[Reply to this message]
|