Yesideez Posted August 19, 2006 Share Posted August 19, 2006 I've created a folder using FTP and this:[code]mkdir("profiles",666);[/code]Both times the folder is created no problem. I need my script to create extra folders inside "profiles" on the fly as users register yet when I try this:[code]mkdir("profiles/oliveri",666);[/code]I get this error message:[code]Warning: mkdir(profiles/oliveri): Permission denied in /home/randgigs/public_html/profile.php on line 8[/code]The value 666 in mkdir() is for read & write access.Can someone tell me where I'm going wrong please?Many thanks. Quote Link to comment Share on other sites More sharing options...
Yesideez Posted August 19, 2006 Author Share Posted August 19, 2006 I seem to have a case of "post a question then find the answer yourself"... :SChange 666 to 0666 for octal and it works.Only problem is, any picture I upload into profiles/oliveri/ gives me a 403 (Forbidden) when I try and display them.Any idea of what permissions I have to set the "oliveri" folder to allow anyone access to it without letting the general public delete files contained within these folders? Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted August 19, 2006 Share Posted August 19, 2006 Try 755 or 766. Quote Link to comment Share on other sites More sharing options...
Yesideez Posted August 19, 2006 Author Share Posted August 19, 2006 Thanks, just been reading up on it and discovered that if a folder is set to "execute" it doesn't mean files in that folder can be executed (as I thought) but means that the folder can be searched/browsed.Now just got to add a small index.html file in each folder to stop people browsing them... Quote Link to comment Share on other sites More sharing options...
sarman Posted August 19, 2006 Share Posted August 19, 2006 good style also is put just one .htaccess with "deny from all" directive at the top of this tree of folders - and they never will be shown to user. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.