PHP Classes

File: example1.php

Recommend this page to a friend!
  Classes of Tomasz Malewski   ADV_FTP   example1.php   Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: Example 1
Class: ADV_FTP
List the files in a FTP server recursively
Author: By
Last change: make public
Date: 12 years ago
Size: 791 bytes


Class file image Download

require 'adv_ftp.php';
$ftp = new adv_ftp();
$ftp->conn('', '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);
"<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