denied"); echo "SUCCESSFULLY CONNECTED\n\n"; return $ftp; } /** * Read the files */ function get_dirs_files ($ftp, $pfad="/") { if ($contents = ftp_rawlist($ftp["conn_id"], $pfad)) { //print_r($contents); foreach( $contents as $key => $filedir) { $item = split("[ ]+",$contents[$key],9); //echo "
".$contents[$key]."
"; if(ereg("^d(.*)",$item[0])) { echo "<dir> - " . $pfad.$item[8] . "\n"; get_dirs_files($ftp, $pfad.$item[8]."/"); } else { echo " " . $pfad.$item[8] . " (Size: ".$item[4].")\n"; } } // foreach } // if } /**************************************************************/ echo "
";

    if (test_ftp_connection($ftp))
    {
        $ftp = conn2ftp($ftp);
        get_dirs_files($ftp);
    }
    else
    {
        echo "no ftp-server on this ip : " . $ftp["server"];
    }

    echo "
"; ?>