Hi, i have this code to make a directory on my server, but it is not working?? any ideas??
the directory i would like to make the folder in is called work!
[MAIN DIR] > [SCHOOL] > [WORK] > [MAKE FOLDER HERE]
these are the errors i get:
any ideas??
Regards,
Martin
Gaming Help And Info:
Code:
function FtpMkdir($path, $newDir) {
$server='host'; // ftp server
$connection = ftp_connect($server); // connection
// login to ftp server
$user = "username";
$pass = "pass";
$result = ftp_login($connection, $user, $pass);
// check if connection was made
if ((!$connection) || (!$result)) {
return false;
exit();
} else {
ftp_chdir($connection, $path); // go to destination dir
if(ftp_mkdir($connection,$newDir)) { // create directory
return $newDir;
} else {
return false;
}
ftp_close($conn_id); // close connection
}
}
FtpMkdir("work", $u);
the directory i would like to make the folder in is called work!
[MAIN DIR] > [SCHOOL] > [WORK] > [MAKE FOLDER HERE]
these are the errors i get:
Code:
Warning: ftp_chdir(): Can't change directory to work: No such file or directory in /home2/webrevol/public_html/school/signup3.php on line 32
Warning: ftp_mkdir(): Can't create directory: File exists in /home2/webrevol/public_html/school/signup3.php on line 33
Regards,
Martin
Gaming Help And Info: