Temel kullanım

Örnek 1 - FTP örneği

<?php
// Bağlantıyı kuralım
$bt = ftp_connect($ftp_sunucu);

// kullanıcı adı ve parola ile oturum açalım
$bağlantı = ftp_login($bt, $ftpci, $ftpci_parolası);

// bağlantıyı sınayalım
if ((!$bt) || (!$bağlantı)) {
    echo "FTP bağlantısı kurulamadı!";
    echo "$ftpci için $ftp_sunucu sunucusuna bağlanmaya çalışılıyordu.";
    exit;
} else {
    echo "$ftpci için $ftp_sunucu sunucusuna bağlantı kuruldu.";
}

// Dosyayı sunucuya yükleyelim
$yükleme = ftp_put($bt, $hedef, $kaynak, FTP_BINARY);

// Duruma bakalım
if (!$yükleme) {
    echo "FTP dosya yüklemesi başarısız oldu!";
} else {
    echo "$kaynak dosyası $ftp_sunucu sunucusuna ";
    echo "$hedef dosyası olarak yüklendi.";
}

// FTP bağlantısını kapatalım
ftp_close($bt);
?>

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top