Apple iPod shuffle 4 GB Mavi
Coby MP305-2G MP3 Player
Apple iPad 64gb Wi-Fi 3G
Nokia N8 Touchscreen Phone Beyaz - gps navigation, Voice Navigation, 12 MP Camera
:: HOME PHP Creating Folder With FTP
Creating Folder With FTP

If you want to create a folder with using PHP you can just use mkdir function of PHP to do it. as a first variable we define folder and then we define mod of folder.

    mkdir("foldername", 0777);

If you dont know what these numbers mean, you need to check CHMOD.

But some times because of authentication, you can not define CHMOD with mkdir function. The best way to create folder with PHP is using ftp.

function FTPmkdir($name, $mod = 777)

    $path="/httpdocs/"; // location
    $server='';  // server IP address
    $connection = ftp_connect($server);

    $user = ""; // FTP user name
    $pass = ""; // FTP password
    $result = ftp_login($connection, $user, $pass);

    if ((!$connection) || (!$result)) {
        return false;
    } else {
        if (!ftp_chdir($connection, $path)) {
            $r = false;
        } else if (!ftp_mkdir($connection,$newDir)) {
            $r = false;
        } else if (!ftp_site($connection, "CHMOD ".$mod."/".$path."/".$newDir))
            $r = false;
        } else {
            $r = $newDir;
    return $r;


Here you just need to send folder name to function. Also if you want you can send to CHMOD too. You need to type your server IP address, location for new folder, ftp user name and password.


Thats it.