When my users create an account, my code creates personal folders for them.
$currentdir=getcwd();
$savedir="$currentdir/users/$_COOKIE[username]/albums/$_POST[albumname]";
mkdir($savedir,0777);
BUT it isnt creating the folders with a 777 permission. Its a Linux server running Apache. How can I make my script create the folders with 777 chmod by default?
Any help greatly appreciated
john
Folder permissions and PHP
Moderator: General Moderators
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
if $currentdir = 'foo' the value of $savedir after the assignment is:Read the PHP manual on strings, in particular variable substitution in double quoted strings.
Code: Select all
foo/users/Array[username]/albums/Array[albumname]