Easiest way to track member levels?

Discussion in 'Customization & add-ons' started by chrislockwood, Feb 12, 2007.

  1. chrislockwood

    chrislockwood New Member

    Joined:
    Jan 4, 2007
    Messages:
    11
    Say I have an amember-powered site with different membership levels, like gold and silver.

    The gold members have access to everything the silver ones get, plus more.

    So I would put content in the silver directory that all members have access to.

    The menu the user sees should be different depending on whether he is gold or silver, so on one of the common pages the code needs to know which type of membership the user has.

    I want it to look like this:
    if (memberlevel = gold)
    display gold menu;
    else
    display silver menu;

    What I want is a global variable I can check to tell which type of member the person is.

    I have programming experience but am a novice at PHP and have been reading about global variables. It seems like what I think of as global is only global to the file it's in.

    Since each page of the site is a separate php file, if I set the variable in one file, the value doesn't carry to another file.

    What's the best way in PHP to implement a variable like this reliably? Also, where should I set the variable? It would have to be where I know which member level they are, obviously, but it needs to maintain its value as that user navigates around the member area, and needs to be a unique variable for that user.

    Thanks.
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021

Share This Page