Login   Register  
PHP Classes
elePHPant
Icontem

File: ftptest.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Harish Chauhan  >  ftp.inc  >  ftptest.php  >  Download  
File: ftptest.php
Role: Example script
Content type: text/plain
Description: example file
Class: ftp.inc
FTP client implementation with socket connections
Author: By
Last change:
Date: 9 years ago
Size: 1,069 bytes
 

Contents

Class file image Download
<?php

    
include_once("ftp.inc.php");
    
    
//$ftp=new FTP(true); //For using port
    
$ftp=new FTP(); // Passive connection
    
$host="your.site.domain";
    
$user='user';
    
$pass='password';
    if(!
$ftp->connect($host))
         die(
$ftp->error());
    echo 
nl2br($ftp->greet());
    
$ftp->login($user,$pass);
    echo 
"<br>";
    echo 
$ftp->error();
    echo 
"<br>";
    echo 
nl2br($ftp->features());
    
//$ftp->chdir("www");
    
echo "<br>";
    echo 
date("M d, Y @ h:i:s",$ftp->mdtm("phpinfo.php"));
    echo 
"<br>";
    
//$ftp->cdup("test");
    //echo $ftp->read("reference1.html");
    //echo $ftp->write("reference1.html");
    //$ftp->rename("reference1.html","newFile.html" );
    //$ftp->delete("newFile.html");
    //$ftp->mkdir("myDir");
    //$ftp->rmdir("myDir");
    //echo $ftp->pwd();
    //print_r($ftp->rawlist());
    //print_r($ftp->namelist());
    //echo $ftp->system();
    //echo $ftp->site("CHMOD myFile");
    //echo "<br>";
    //echo nl2br($ftp->help());
    
$ftp->noop();
    echo 
"<br>";
    echo 
$ftp->error();
    echo 
"<br>";
    
$ftp->Verbose=true;
    echo 
"<br>";
    echo 
nl2br($ftp->sendMsg());
    
?>