首页  >  文章  >  php教程  >  php 模仿ftp文件上传实例

php 模仿ftp文件上传实例

WBOY
WBOY原创
2016-06-13 11:22:501213浏览

$mymode   = FTP_ASCII;
$delete   = 0;
$local_dir   = "/my_local_download_directory";
$host    = "ftp.yahoo.de";
$remote_dir   = ".";
$anonymous  = 0;
$user    = "myusername";

核心代码

class myftp {

 var $connector;
 var $getback;
 
 function connect($ftp_server, $uname, $passwd){
 // Baut grundlegende FTP Connection auf
  $this->connector = @ftp_connect($ftp_server);
  $this->login_result = @ftp_login($this->connector, "$uname", "$passwd");
  if ((!$this->connector) || (!$this->login_result))
  {
          echo "FTP connection has failed! n";
          echo "Attempted to connect to $ftp_server for user $uname n";
          die;
      } else {
          echo "Connected to $ftp_server, for user $uname n";
      }
 }

 function lastmodtime($value){
  $getback = ftp_mdtm ($this->connector,$value);
  return $getback;
 }

 function changedir($targetdir){
  $getback = ftp_chdir($this->connector, $targetdir);
  return $getback;
 }
 function getdir(){
 // Liefert Directory Namen zur

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
上一篇:php mage2wbmp 函数下一篇:php getimagesize