ftp类(myftp.php)

_______裤衩子

_______裤衩子

2016-02-19 12:12

今天天气好晴朗处处好风光,好天气好开始,图老师又来和大家分享啦。下面给大家推荐ftp类(myftp.php),希望大家看完后也有个好心情,快快行动吧!

?php

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 connection has failed! n";
                echo "Attempted to connect to $ftp_server for user $uname n";
                die;
            } else {
                echo "Connected to $ftp_server, for user $uname n";
            }
    }

    function lastmodtime($value){
        $getback = ftp_mdtm ($this-connector,$value);
        return $getback;
    }

    function changedir($targetdir){
        $getback = ftp_chdir($this-connector, $targetdir);
        return $getback;
    }
    function getdir(){    
        $getback = ftp_pwd($this-connector);
        return $getback;
    }

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

    function get_file($file_to_get, $mode, $mode2){
        $realfile = basename($file_to_get);
        $filename = $realfile;

        $checkdir = @$this-changedir($realfile);
        if ($checkdir == TRUE){
            ftp_cdup($this-connector);
            echo "n[DIR] $realfile";
        }else{
            echo "..... ". $realfile ."n";
            $getback = ftp_get($this-connector, $filename, $realfile, $mode);
            if ($mode2){
                $delstatus = ftp_delete($this-connector, $file_to_get);
                if ($delstatus == TRUE){
                    echo "File $realfile on $host deleted n";
                }
            }
        }
        return $getback;
    }

    function mode($pasvmode){
        $result = ftp_pasv($this-connector, $pasvmode);
    }

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

?

展开更多 50%)
分享

猜你喜欢

ftp类(myftp.php)

Web开发
ftp类(myftp.php)

ftp类(example.php)

Web开发
ftp类(example.php)

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

一个ftp类(ini.php)

Web开发
一个ftp类(ini.php)

PHP的FTP学习(三)

PHP
PHP的FTP学习(三)

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

PHP的FTP学习(四)

PHP
PHP的FTP学习(四)

PHP的FTP学习(一)

PHP
PHP的FTP学习(一)

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

C#深入浅出全接触(四)

C#深入浅出全接触(四)

PHP 和 HTML

PHP 和 HTML
下拉加载更多内容 ↓