Project and Portfolio Management Practitioners Forum
cancel

PHP User Management with custom directories question

Highlighted
simy ryan
New Member.

PHP User Management with custom directories question

Yet another PHP/MySQL user management question. http://www.phpkode.com/scripts/category/php-user-management/ It's for an image editor, and so each user should have their own "space" i.e. user directory (USERDIR) upon signing up, and anything under that directory should be accessible to the relevant user only. Fairly simple step up but I can't seem to find the right keywords to search for a tutorial.

The way I was thinking of implementing it is having a "USERDIR" column in the MySQL db along side "USERID" and "PASSWORD" (md5 hashed) (although I understand USERDIR is a redundant key if USERIDs are also unique - is this an issue to be worried about? i.e. I could just assign the USERID as the directory name instead of generating a unique random directory name). How do I then "check" whether the user has the privileges to access their directory (i.e. how do I code it to check the sessionID/cookie checking to stop another user from going to mysite.com/USERID or mysite.com/USERDIR). I appreciate this is really basic and repetitive for some of you but I can't seem to find the relevant tutorials anywhere! Any help much appreciated.