Make directory/folder on server
Posted: Thu Mar 06, 2008 4:28 am
Mod | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
Scenario: I have 2 servers here....SERVER M (hosting the script) and SERVER S (where I want to create new folder).
I want to create a folder on a SERVER S by running the following script that's hosted on SERVER M. Folder home$ already exists in SERVER S, hence it only needs to create a PPan folder.
However, if I run the script from my PC (which is not the SERVER M), it doesn't work. But if I login as me on SERVER M and run the script there, it works fine.
If I make a copy of the script and host it locally on my localhost, running the same script, it works - it creates PPan folder on server S. I know it's a security issue but I don't know what it is.
I've also tried below but same result:
Could anyone nice people help me please?
Mod | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
Scenario: I have 2 servers here....SERVER M (hosting the script) and SERVER S (where I want to create new folder).
I want to create a folder on a SERVER S by running the following script that's hosted on SERVER M. Folder home$ already exists in SERVER S, hence it only needs to create a PPan folder.
Code: Select all
if (mkdir('\\\\s/home$/PPan',0777))
{
echo ("made directory");
}
else
{
echo ("cannot make directory");
}
If I make a copy of the script and host it locally on my localhost, running the same script, it works - it creates PPan folder on server S. I know it's a security issue but I don't know what it is.
I've also tried below but same result:
Code: Select all
$folderPath = '\\\\sal/home$/PPan';
$oldumask = umask(0) ;
mkdir( $folderPath, 0777 ) ;
umask( $oldumask ) ;Mod | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: