View Full Version : Creating Directories
Temper
12-22-2002, 09:13 PM
I'm trying to figure out how to create directories with php. What I want to do is set up accounts for users, and the first time they log on, a directory is created for them where they can access their files. Does anyone know a php script that will do this for me?
Thanks
~Mike
mordred
12-22-2002, 10:22 PM
For a start, this could be useful to you:
http://www.php.net/manual/en/function.mkdir.php
remember that you'll have to chmod the parent directory to allow write permissions.
mkdir('../parentdirectory/'.$user_name);
also note: you'll need to test that the username doesn't have dodgy characters in it like / ' " and stuff. It might be easier (and more sensible) to use an auto-increment id value from the database as the name for the folder.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.