array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'ftp.examples-basic.php', 1 => 'Temel kullanım', ), 'up' => array ( 0 => 'ftp.examples.php', 1 => 'Örnekler', ), 'prev' => array ( 0 => 'ftp.examples.php', 1 => 'Örnekler', ), 'next' => array ( 0 => 'ref.ftp.php', 1 => 'FTP İşlevleri', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'tr', 'path' => 'reference/ftp/examples.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
Ö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);
?>