ホームページ  >  記事  >  バックエンド開発  >  FTP クラス (myftp.php)_PHP チュートリアル

FTP クラス (myftp.php)_PHP チュートリアル

WBOY
WBOYオリジナル
2016-07-21 16:10:14981ブラウズ



class myftp {

var $connector;
var $getback;

function connect($ftp_server, $uname, $passwd){
// Baut grundlegende FTP Connection auf
$this->connector = @ftp_connect($ftp_server);
$this->login_result = @ftp_login($this->connector, "$uname", "$passwd");
if ((!$this->connector)
(!$this->login_result))
{
echo "FTP 接続に失敗しました! n";
echo "ユーザー $uname n の $ftp_server に接続しようとしました";
死ぬ。
} else {
echo "ユーザー $uname n の $ftp_server に接続しました";
}
}

function lastmodtime($value){
$getback = ftp_mdtm ($this->コネクタ,$value);
return $getback;
}

関数Changedir($targetdir){
$getback = ftp_chdir($this->connector, $targetdir);
return $getback;
}
関数getdir(){
$getback = ftp_pwd ($this->connector);
return $getback;
}

function get_file_list($directory){
$getback = ftp_nlist($this->connector, $directory);
return $getback;
}

関数get_file($ file_to_get、$ mode、$ mode2){
$ realfile = basename($ file_to_get);
$ filename = $ realfile; ($checkdir == TRUE){
ftp_cdup($this->connector);
echo "n[DIR] $realfile";
}else{
echo ".... "。 $ realfile。 "n";
$ getBack = ftp_get($ this-> connector、$ filename、$ realfile、$ mode); $file_to_get);
if ($delstatus == TRUE){
echo "$host 上のファイル $realfile が削除されました n";
}
}
}
return $getback;
}

関数モード($pasvmode){
$result = ftp_pasv($this->connector, $pasvmode);
}

function ftp_bye(){
ftp_quit($this->connector);
return $getback;
}
}

?>


www.bkjia.comtru​​ehttp://www.bkjia.com/PHPjc/314323.html技術記事 ?php クラス myftp { var $connector; var $getback; function connect($ftp_server, $uname, $passwd){ // FTP 接続を確立 $this-connector = @ftp_connect($ftp_server)...
声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。