Advertisement
Guest User

Untitled

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