Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2008

    Unanswered: webdatabase help!


    im creating a webdatabase program thats kind of like flickr
    im abit stuck and could really use some help! so thanks in advanced!

    ive managed to get session authentication through username password verification from a table in the database.

    im abit confused now, as it seems i need to grant every user specifically with rights to do certain things.

    say i want users to only be able to edit their own photos but view all photos , how do i do this? andif i give them that access will they not be able to view all the data from say the user tables which isnt good?

    i assume the best way would be to write some php code that will selfcode the GRANT SELECT etc etc for each user during the registration step?

    please give me some pointers!

    even then how will i make

  2. #2
    Join Date
    Apr 2008
    West Sussex
    I have something similar to what you want on my site.

    Let me find the code...

    I have a table called usergroup. It has a groupid, for example groupid "1" is administrators.

    In the users table i would have a collumn called level, which for ME would contain the level "1" (the super admin level).

    Then it selects my level from the table usergroups and checks if my permissions = yes

    PHP Code:
    if ($userlevel[caneditphoto] == "yes"){


    PHP Code:
    // User Permission check, tested 11/04/08
    if ($_SESSION[id] != ""){
    $userpermcheck mysql_query("SELECT * FROM `usergroup` WHERE `groupid` = '$userdet[level]'");
    $userperm mysql_fetch_array($userpermcheck);
    // User Permission check, tested 11/04/08 
    Excuse messy coding, only 14 years old lmao.

    But still its easy to do. If you need any more help then just reply, if i have posted the wrong response feel free to spam me lmao

    Oh and you would have the default table values for permissions such as logout as yes. :P
    Last edited by Jackboy; 04-25-08 at 17:57.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts