Need some help with a dynamic menu bar

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Martien van Wanrooij

    #1

    Need some help with a dynamic menu bar

    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($locati e, $verwijzing)) //link to the
    current page so no need to make it clickable
    echo $omschrijving." $separator";
    else echo ("<a class = \"menu\" href =
    \"$verwijzing\" >$omschrijvin g</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
    "Koninginne dag" page is active, the "Koninginne dag" 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.


  • Sjoerd

    #2
    Re: Need some help with a dynamic menu bar

    $_SERVER['REQUEST_URI']

    Comment

    • Martien van Wanrooij

      #3
      Re: Need some help with a dynamic menu bar

      "Sjoerd" <sjoerder@gmail .com> schreef in bericht
      news:1145284345 .591906.248060@ g10g2000cwb.goo glegroups.com.. .[color=blue]
      > $_SERVER['REQUEST_URI']
      >[/color]
      Thank you Sjoerd, but when I replaced the PHP_SELF with REQUEST_URI the
      function didn't work with anymore menu items at all. I did a quick test with
      echo $_SERVER['PHP_SELF'] which returned the actual php file preceded by a
      slash, but echo $_SERVER['REQUEST_URI'] didn't return anything at all.
      Could you still give me a hint? I must say that I am not very familiar with
      settings like php.ini maybe it has to do something with that?

      Martien.


      Comment

      Working...