SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    If in array show selected?!?

    I'm trying to make my tab menu to work so if a certain parameter is fullfilled it will show up as selected... I want my "START" tab to be selected if my page is either "index.php?ga=news" or "index.php?ga=info", and mayby more options, but lets start with this...

    This is what I have done:
    PHP Code:
    $page urlencode($_GET['ga']);

    $startTab = array('news','info');

    if(
    $page == $startTab){
            echo 
    '<li class="selected"><a href="index.php?ga=news">Start</a></li>';
        } else {
            echo 
    '<li><a href="index.php?ga=news">Start</a></li>';
        } 
    But it doesnt work... Where do I go wrong?

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,151
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)

  3. #3
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks... Did the job :-)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •