Quote:
Originally Posted by dansgalaxy
hey,
I would like to make a simple system where a user signs up.
they can then login and uplaod/delete files within a folder.
the folder will be created on sign up and will be called something of thier choice.
How would i have it so they could do this?
so they cant edit/delete uplaod to others folders
this is just a system i want for a class project we are making basic sites only html and i just want to try and make it so everyone can put them "live"
so please any body with some idea of the best ways to do some or all of this please tell!
Thanks
TP for all good and helpful answers
|
It sounds like all you need is a few php functions.
mkdir will make a directory
fopen can make a file:
$FileName = "file.php";
$FileHandle = fopen($FileName, 'w') or die("can't open file");
fclose($FileHandle);
What that does is looks to open the file if it can't find it it creates it.
So just make a signup form. Whatever username they use - use that in your mkdir command ie:
$folder = $_POST['username'];
mkdir("/path/to/public_html/folderhosting/$folder", 0777);
Now when they login you can have your upload script where when they upload any files just put the files into their particular folder based on the username they are logged in with.
|