Warning: mkdir() [function.mkdir]: No such file or directory PHP? -


i getting error when trying use mkdir() function in php.

basically creating sundomain on server based on input field in html form named (input).

now trying create directory in subdomain after has been created.

so use following code :

$subdomain= $_post['input'];  mkdir("$subdomain.mydoamin.com/newdirectory", 0755); 

but following error:

warning: mkdir() [function.mkdir]: no such file or directory in line 99. 

and on line 99 this:

mkdir("$subdomain.mydoamin.com/newdirectory", 0755); 

as note: subdomain gets created successfully. know subdomain 100% exist on server. don't know why error!

could please advise on issue?

thanks in advance.

try put third parameter. method signature is:

bool mkdir ( string $pathname [, int $mode = 0777 [, bool $recursive = false [, resource $context ]]] ) 

so code be:

mkdir(__dir__ . "/$subdomain.mydoamin.com/newdirectory", 0755, true); 

Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -