Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. <?php
  2.  
  3. // Testing the FTP Module
  4. error_reporting(2047); // 2047 is everything
  5.  
  6. $ftpHost = "173.203.139.154";
  7. $ftpPort = "21";
  8. $ftpUser = "djohn";
  9. $ftpPassword = "i77k3m88-$#";
  10.  
  11. if(function_exists('ftp_connect')) {
  12. echo "ftp_connect() function is enabled <br/>";
  13. $ftpResource = ftp_connect($ftpHost, $ftpPort);
  14.  
  15. if(!$ftpResource)
  16. {
  17. echo "Could not connect to: ".$ftpHost." using port: ".$ftpPort."<br/>";
  18. }
  19. else
  20. {
  21. echo "Connected to: ".$ftpHost."<br/>";
  22.  
  23. // Testing login with user / pass
  24. if(!ftp_login($ftpResource, $ftpUser, $ftpPassword))
  25. {
  26. echo "Could not log in with username: ".$ftpUser." and password: ".$ftpPassword."<br/>";
  27. }
  28. else
  29. {
  30. echo "Success! We are now logged in with: ".$ftpUser;
  31. }
  32. }
  33. }
  34. else {
  35. echo "ftp_connect() function or the php ftp module is not enabled on this server. Exiting...";
  36. }
  37.  
  38.  
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement