Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2. #
  3. # example of use ftp client
  4. #
  5. $ftp_server = "127.0.0.1";
  6. $ftp_username = "*****";
  7. $ftp_userpass = "*****";
  8. $ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
  9. $login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass);
  10.  
  11. // then do something...
  12.  
  13. ftp_chdir($ftp_conn, "scan");
  14. $file_list = ftp_nlist($ftp_conn, ".");
  15. #var_dump($file_list);
  16.  
  17. foreach($file_list as $file){
  18. ftp_delete($ftp_conn, $file);
  19. $delfiles = "$delfiles <li> $file ";
  20. }
  21.  
  22. // close connection
  23. ftp_close($ftp_conn);
  24.  
  25.  
  26. echo "<html><body><ul> <h3>deleted</h3> ";
  27. echo $delfiles;
  28. echo "</ul></body></html>";
  29.  
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement