sinus Posted November 21, 2007 Share Posted November 21, 2007 I am using the script below to create new folders projectID = 1; $oldumask = umask(0); $mypath = "public/projects/$projectID"; mkdir($mypath, 0777, TRUE); umask($oldmask); The the folder is not being created in the projects folder and I get no error messages. I have chmod the projects folder to 0777 so I should be able to write to it. The really only thing I am doing strange is that the script trying to create the new folders is located in public/content_management/. The public folder is the one that my ISP create and everything in there is access on the web. Any help would be great. Quote Link to comment Share on other sites More sharing options...
msimonds Posted November 21, 2007 Share Posted November 21, 2007 I tried your code on my locahost (using wamp) and added one line $server_path = $_SERVER["DOCUMENT_ROOT"]; $projectID = 256; $oldumask = umask(0); $mypath = $server_path . "/" . $projectID; mkdir($mypath, 0777, true); umask($oldmask); and it works for me! Try that or maybe define your path as a constant ~Mike Quote Link to comment Share on other sites More sharing options...
sinus Posted November 22, 2007 Author Share Posted November 22, 2007 Hi Mike Thanks for your help it worked exactly as I needed it to. Thanks alot. 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.