PHP – Create directory


PHP – Create directory

$restna=”100001″;
function FtpMkdir($path, $newDir) {

$server=’ftp.doubledots.com’; // ftp server
$connection = ftp_connect($server); // connection

// login to ftp server
$user = “me”;
$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(“/public_html/Restaurant/images/Restaurant”, $restna) ;

Advertisements

thanks 4 u comments..

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s