PHP写的FTP类

作者:计算机教程

<?php

<?php

class myftp {

class myftp {

    var $connector;
    var $getback;

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 nba买球,n";
            }
    }

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 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 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_list($directory){
$getback = ftp_nlist($this->connector, $directory);
return $getback;
}

本文由nba买球发布,转载请注明来源

关键词: