PHP ftp_site() İşlevi
Örnek
Bir FTP SITE komutu gönderin:
<?php
// connect and login to FTP server
$ftp_server = "ftp.example.com";
$ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
$login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass);
// try to send SITE command
if (ftp_site($ftp_conn, "chmod 777 serverfile.txt"))
{
echo "Command executed successfully";
}
else
{
echo "Command failed";
}
// close connection
ftp_close($ftp_conn);
?>
Tanım ve Kullanım
ftp_site() işlevi, FTP sunucusuna bir SITE komutu gönderir.
Not: SITE komutları sunucudan sunucuya değişir. Dosya izinleri ve grup üyeliği gibi işletim sistemine özgü özellikleri işlemek için kullanışlıdırlar.
İpucu: Hangi SITE komutlarının kullanılabilir olduğunu görmek için ftp_raw() işlevini kullanarak REMOTEHELP komutunu gönderin.
Sözdizimi
ftp_site(ftp_conn, command);
Parametre Değerleri
Parameter | Description |
---|---|
ftp_conn | Required. Specifies the FTP connection to use |
command | Required. Specifies the SITE command (this parameter is not escaped) |
Teknik detaylar
Geri dönüş değeri: | Başarıda DOĞRU, başarısızlıkta YANLIŞ |
---|---|
PHP Sürümü: | 4+ |
❮ PHP FTP Referansı