Forum Moderators: coopster
A user goes to a page on the site:
------------------------------------------------
1. The page prompts the user to create a user ID/Password.
2. A folder is created for the user, which is protected by their user ID/Password.
3. The user is then allowed to upload/download files to the folder (and no other).
4. When they return to the site, they log in and are immediately taken to their folder.
-------------------------------------------------
Any pointers, code etc. would be greatly appreciated and reciprocated!
((((@
c(.).)
\__>
I can talk it out in pseudocode a bit if that is what you are looking for ...
2. is the most difficult for me:
I can use mkdir to create the folder for the user, but I can't figure out how to lock read/write/execute priveledges to just the user.
For instance,
mkdir("/user",0700);
would create the user's folder, and while the permissions are locked to the "owner", the "owner" is the webserver, not the person currently logged in when the script is called.
Thanks again!
mkdir("/user",0700);
only the webserver has access to user. But it doesn't matter since I should be able to make a PHP page that compares ID/password to the DB, then asks the webserver to feed the contents of the user directory back to the user.
I'll also need something else to keep them logged in though so they can navigate the files, which I guess would be a cookie. Am I on the right track?
To initiate:
session_start();// always on top of script
// post value through $_POST
$username=$_POST['username'];
$password=$_POST['password'];
$_SESSION['username'] = $username;
$_SESSION['password'] = $password;
To use it:
session_start()
$username=$_SESSION['username'];
// etc...
// all pages the need the username session
// will start by SESSION_START()
Check the manual
[us2.php.net...]
Thank's everyone for your input!