Hiding Content Per Subscription

Discussion in 'Setting-up protection' started by darren_s2, Aug 27, 2006.

  1. darren_s2

    darren_s2 New Member

    Joined:
    Aug 22, 2006
    Messages:
    1
    I have looked through all 9 pages here and havent seen this question asked yet so here goes.

    I have 3 packages created. If is possible to have a page (lets call it index.php) and have sections of that page hiddent to different packages.

    Eg

    Navigations - If group 1 logged in they would see the navigation assigned to their group but will not see group 2 and 3. If group 2 logged in they would see the navigation assigned to their group but will not see group 1 and 3. And If group 3 logged in they would see the navigation assigned to their group but will not see group 1 and 2.

    I saw this asked when asking about the template files (Click Here) But I want it to work on non template pages. (PHP)
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    you may use something like that in your PHP

    PHP:
    <?php
    session_start
    (); ?>
    some html here common for all products
    ....
    <?php if (in_array(3$_SESSION['_amember_product_ids'])){ ?>
    HERE you insert html suitable for product#3 only
    <?php ?>
    ..................
    <?php if (in_array(2$_SESSION['_amember_product_ids'])){ ?>
    HERE you insert html suitable for product#2 only
    <?php ?>
  3. tedc

    tedc New Member

    Joined:
    Apr 18, 2007
    Messages:
    5
    This doesnt work for me, my $_SESSION is an empty array. I am using new_rewrite, is this a problem? Why is my $_SESSION empty?

    Thanks
  4. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    don't forget
    session_start();
    in start line of the script.

Share This Page