Session Variables

Discussion in 'Integration' started by nofrills, Jul 3, 2008.

  1. nofrills

    nofrills New Member

    Joined:
    Apr 5, 2007
    Messages:
    10
    I would like to do this:

    Depending on the type of subscription a user signs up for, I want it to control a specific permission level of searching from a database.

    Ex. Search for Houses.

    Houses are categorized in the database already as level 1, 2 and 3.

    If user only signed up for level 2, he would only see 2 and below, not 3.


    I can't figure out the session variables for products. If I knew those I could write a simply code before the after the SQL.

    I need to know how to retrieve the session variable in question.

    And is there a list/chart somewhere that maps out all the session variables.

    I did the print_r($_SESSION); but that didn't help me one bit.
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
  3. nofrills

    nofrills New Member

    Joined:
    Apr 5, 2007
    Messages:
    10
    I appreciate the link, but unfortunately it didn't help any.

    Perhaps if I address my question another way.

    Is there a session variable that keeps track of what product that the user has?

    Or is that something that needs to be searched for in the database?

    What fields fall under the _amember_user session ?
  4. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
  5. nofrills

    nofrills New Member

    Joined:
    Apr 5, 2007
    Messages:
    10
    After doing some searching in the forums, I discovered this from Alex which will work for what I need- I tweaked it a little.

    if (in_array(4, $_SESSION['_amember_product_ids'])) {

    echo ("You have purchased Product 4 already");

    }


    4 being the product_id I am checking for.


    I appreciate your help David. I found a lot of informative things searching and from your links.

Share This Page