Creating directories on a server with PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jim
Forum Contributor
Posts: 238
Joined: Fri Apr 19, 2002 5:26 am
Location: Near Austin, Texas

Creating directories on a server with PHP

Post by Jim »

Is it possible to create a script which would allow someone to create a directory on a server without actually having to FTP in?

If there is, how can it be done?

Thanks :)
chris12295
Forum Contributor
Posts: 113
Joined: Sun Jun 09, 2002 10:28 pm
Location: USA
Contact:

Post by chris12295 »

to make a directory just do the following:

this will make a directory and set the privleges.

mkdir('path', 0777);

might need to add umask.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

only notes:
0777 grants read/write/execute to everyone
first check that the path is in 'your space' on the server.
It's not nice (and also a failure of the provider, of course) if someone creates '/tmp2' or similar
Jim
Forum Contributor
Posts: 238
Joined: Fri Apr 19, 2002 5:26 am
Location: Near Austin, Texas

Post by Jim »

Maybe I should have posted this here. Nonetheless:

Umask Problems (Post)

Thanks :)
Post Reply