tags:

views:

46

answers:

1

I am trying to create folder like this

$destination = "../enumesis.com/_pcode/../_compile";
mkdir($destination);

But this gives error

UPDATE What i am doing is, taking ../enumesis.com/_pcode as input from user and I want to create a folder outside the _pcode Directory

Here is my error

Warning: mkdir() [function.mkdir]: No such file or directory in G:\wamp\www\tools\compile.php on line 57
../enumesis.com/_pcode/../_compile
+4  A: 

It is likely that you're trying to create a subdirectory within a non-existing directory, in this case, if you want to create the whole directory path, try setting mkdir's $recursive parameter to true:

mkdir($destination, 0777, true);
Alexander Konstantinov