Admin or Registered user??

Discussion in 'PHP' started by ausgezeichnete, Nov 30, 2007.

  1. #1
    Plz i have this problem
    i dont know how to differ between them
    to restrict access on certain pages??????????
    i have restricted pages to registered users only ......
    i dont know how to arrange the database too to make user types??
    as i am new to PHP projects.....
     
    ausgezeichnete, Nov 30, 2007 IP
  2. selling vcc

    selling vcc Peon

    Messages:
    361
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can add a field on a database
    - Data type : ENUM
    - Possible values : 0, 1, 2, 3, ... depending on the privilegies you want

    Then you test this field on you script to know what data you will display to the user.
     
    selling vcc, Nov 30, 2007 IP
  3. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #3
    first try to create a table that holds the user types.
    - Administrator
    - Registered User
    - Client
    - etc...

    then detect the user type of the user in your script...
    try to make the restrictions
    1 - admin
    2 - registered user
    3 - client
    4 - etc.
     
    bartolay13, Nov 30, 2007 IP