Make a folder and copy template files to it with PHP?

Okay.. File IO I'm fine with. I can move them.. but whats the boogering code for making a directory. mkdir() doesn't seem to do it. I have chmodded lucky 7s in the folder in question...

Any takers?
Also.. why would my forms work if I am running them on local-host but fail to work when visited from the outside?
Seriously running out of fingernails to bite....

?2011-09-23T13:36:32Z

Favorite Answer

This works perfectly on my host:


<?

/* wherever this particular script will be installed, I want to create a subfolder */

/* Step 1. I need to know the absolute path to where I am now, ie where this script is running from...*/
$thisdir = getcwd();

/* Step 2. From this folder, I want to create a subfolder called "myfiles". Also, I want to try and make this folder world-writable (CHMOD 0777). Tell me if success or failure... */

if(mkdir($thisdir ."/myfiles" , 0777))
{
echo "Directory has been created successfully...";
}
else
{
echo "Failed to create directory...";


}

?>