PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<ftp_mdtmftp_nb_continue>
view the version of this page
Last updated: Thu, 21 Aug 2003

ftp_mkdir

(PHP 3>= 3.0.13, PHP 4 )

ftp_mkdir -- Creates a directory

Description

string ftp_mkdir ( resource ftp_stream, string directory)

Creates the specified directory on the FTP server.

Returns the newly created directory name on success or FALSE on error.

See also ftp_rmdir().



add a note add a note User Contributed Notes
ftp_mkdir
www at w8c dot com
08-Oct-2003 07:31
$conn=@ftp_connect($ftp_server,"21");
$login=@ftp_login($conn,$ftp_name,$ftp_pass);
...
$dirname="aaa/bbb/ccc";
ftp_mkdirs($conn,$dirname);
function ftp_mkdirs($conn,$dirname)
{
    $dir=split("/", $dirname);
    for ($i=0;$i<count($dir)-1;$i++)
    {
        $path.=$dir[$i]."/";
        @ftp_mkdir($conn,$path);   
    }
    if (@ftp_mkdir($conn,$dirname))
        return 1;
}
kiwo1 at yahoo dot com
29-Aug-2002 12:23
<?php
   
    $ftp_server
='180.10.11.12';//serverip
   
$conn_id ftp_connect($ftp_server); 
   
   
   
// login with username and password
   
$user="mart";//username
   
$passwd="575";//password
   
$login_result ftp_login($conn_id$user$passwd); 

// check connection
   
if ((!$conn_id) || (!$login_result)) { 
        echo 
"FTP connection has failed!";
        echo 
"Attempted to connect to $ftp_server for user $ftp_user_name"
        die; 
    } else {
        echo 
"<br>Connected to $ftp_server, for user $user<br>";
    }

   
$serkan="gokerez";
   
ftp_chdir($conn_id,"www.xxx.com");
   if(
ftp_mkdir($conn_id,$serkan)) print ("File is created!"); 

ftp_close($conn_id); 

?>

<ftp_mdtmftp_nb_continue>
 Last updated: Thu, 21 Aug 2003
show source | credits | sitemap | mirror sites 
Copyright © 2001-2003 The PHP Group
All rights reserved.
This mirror generously provided by: http://php.mirrors.ilisys.com.au/
Last updated: Sat 01 Nov 2003 04:13:36 EST EST