brad12345 Posted March 14, 2008 Share Posted March 14, 2008 Hi all How can i create a new directory using mkdir() to upload my images and text to i can upload it to the current directory the page is in but cant seem to figure out how to make a new folder and put them into it using the mkdir() i tryed mkdir("/newfolder/"); but got access permissions error. is this how to create a new folder? or am i doing something wrong. any help much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/96109-mkdir-help/ Share on other sites More sharing options...
Daniel0 Posted March 14, 2008 Share Posted March 14, 2008 That's how you'd do it. You need write permissions in the folder which you are creating the new folder in. In the code you posted you'll create the folder at the root of the HD. You'll most likely not have write permissions there. Quote Link to comment https://forums.phpfreaks.com/topic/96109-mkdir-help/#findComment-492014 Share on other sites More sharing options...
brad12345 Posted March 14, 2008 Author Share Posted March 14, 2008 i c So i created a folder called properties and set CHOMD to 777 and changed the mkdir() to mkdir("/httpdocs/properties/$property_location"); still doesn't work? comes back with insufficient permissions again? Quote Link to comment https://forums.phpfreaks.com/topic/96109-mkdir-help/#findComment-492018 Share on other sites More sharing options...
Daniel0 Posted March 14, 2008 Share Posted March 14, 2008 Are you sure that's the full path to where your files are? Try to do echo getcwd(); to see where your script is located. Quote Link to comment https://forums.phpfreaks.com/topic/96109-mkdir-help/#findComment-492024 Share on other sites More sharing options...
brad12345 Posted March 14, 2008 Author Share Posted March 14, 2008 yup im sure, still didnt work even wen i tryed echo getcwd(); as the directory name. This is a note but im using a variable the user inputs in as the name of the folder being created called $property_location should this effect it at all? Quote Link to comment https://forums.phpfreaks.com/topic/96109-mkdir-help/#findComment-492030 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.