<PRE><?
require 'adv_ftp.php';
$ftp = new adv_ftp();
$ftp->conn('mirrors.kernel.org', 'Anonymous', 'phpclasses@adv-ftp'); // connect for FTP
$ftp->changeDir("/slackware"); // set directory
$ftp->listFiles(); // classic dir directory
// create sample URL with FTP syntax ftp://user:password@host:port/path
echo "<table border=1><tr><th>File Name</th><th>Size</th><th>Unix Date</th></tr>";
foreach ($ftp->dir as $file=>$key){
// print_r ($key);
$url="ftp://".$ftp->username.":".$ftp->password."@".$ftp->hostname."/".$key[dir]."/".$key[filename];
echo "<tr><td><a href='".$url."'>".$url."</A></td><td>".$key[size]."</td><td>".$key[date]."</td></tr>\r\n";
} // foreach ftp
echo "</table>";
// print_R ($ftp->dir); // list class library
exit;
|