Hello,
I have the following class for ftp:

--   class FTP {
    var $host;
    var $port;
    var $username;
    var $password;
    var $connection;
    function FTP($host="localhost",$port=21,$user="anonymous",$password="") {
      $this->host=$host;
      $this->port=$port;
      $this->username=$user;
      $this->password=$password;
    }

    function connect($timeout=90) {
      $this->connection=ftp_connect($this->host,$this->port,$timeout)
or die("we");
    }

    function login() {
      ftp_login($this->connection,$this->username,$this->password);
      ftp_pasv($this->connection,true);
    }

    function close() {
      ftp_close($this->connection);
    }

    function get_files($dir="/") {
      ftp_chdir($this->connection,$dir);
      $array=ftp_nlist($this->connection,ftp_pwd($this->connection));
      var_dump($array);
    }
  }

When I connect to ftp server for my website at
ftp://kkrizka.mybesthost.com and try to use nlist function, it returns
false. But when I used ftp_rawlist, it returned a list of files no
problem. I tried to connect to a ftp server on my computer, and it
worked normally. I am not sure what is wrong...
--
Cheers,
Karol Krizka
6 Gmail Invintations, anyone want them?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to