पीएचपी ftp_site () फ़ंक्शन
उदाहरण
एक FTP साइट कमांड भेजें:
<?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);
?>
परिभाषा और उपयोग
Ftp_site() फ़ंक्शन FTP सर्वर को एक SITE कमांड भेजता है।
नोट: साइट कमांड सर्वर से सर्वर में भिन्न होते हैं। वे ओएस विशिष्ट सुविधाओं जैसे फ़ाइल अनुमतियों और समूह सदस्यता को संभालने के लिए उपयोगी हैं।
युक्ति: यह देखने के लिए कि SITE कमांड क्या उपलब्ध हैं, ftp_raw() फ़ंक्शन का उपयोग करके REMOTEHELP कमांड भेजें ।
वाक्य - विन्यास
ftp_site(ftp_conn, command);
पैरामीटर मान
Parameter | Description |
---|---|
ftp_conn | Required. Specifies the FTP connection to use |
command | Required. Specifies the SITE command (this parameter is not escaped) |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | सफलता पर सत्य, असफलता पर असत्य |
---|---|
पीएचपी संस्करण: | 4+ |
पीएचपी एफ़टीपी संदर्भ