1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Restrict pages, and show regions

Discussion in 'PHP' started by masterofzoo, Sep 29, 2011.

  1. #1
    Hi, I want to know how can I do a page devided into 4 parts or forms, and according to the level of the user in the database , the parts will appear.
    for example:-
    the levels are 1, 2, 3, 4, 5 respectively, and parts of the page is A, B,C,D,E
    if the user is in the first level, part A only appear, if second level"A&B", if third level "A,B&C"........etc.

    The above or this is better Create one link to multiple pages each page will be allowed according to the level of the user, if the user level 1 page "A" Will show, if 2 page "B" will show.... if the level is three page "C" will show /.........etc
     
    masterofzoo, Sep 29, 2011 IP
  2. MarPlo

    MarPlo Member

    Messages:
    97
    Likes Received:
    2
    Best Answers:
    2
    Trophy Points:
    48
    #2
    Hy,
    If you use PHP and store the user's level in a session, for example $_SESSION['level'], you can use something like this:
    if($_SESSION['level'] == 1) {
      echo 'part A';
    }
    else if($_SESSION['level'] == 2) {
      echo 'part A and B';
    }
    else if($_SESSION['level'] == 3) {
      echo 'part A and B and C';
    }
    else if($_SESSION['level'] == 4) {
      echo 'part A and B and C and D';
    }
    else if($_SESSION['level'] == 5) {
      echo 'part A and B and C and D and E';
    }
    Code (markup):
     
    MarPlo, Sep 29, 2011 IP
  3. masterofzoo

    masterofzoo Peon

    Messages:
    18
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    how do I name the parts in forms?
     
    masterofzoo, Sep 29, 2011 IP
  4. MarPlo

    MarPlo Member

    Messages:
    97
    Likes Received:
    2
    Best Answers:
    2
    Trophy Points:
    48
    #4
    Hi,
    I don't know, depends on what you want to make, that was just an example to inspire for.
     
    MarPlo, Oct 1, 2011 IP