Advertisement
Guest User

Untitled

a guest
Jan 8th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1.  
  2. <?php
  3.  
  4. $ftp_server = "ftp.example.com";
  5. $ftp_user = "foo";
  6. $ftp_pass = "bar";
  7.  
  8. // set up a connection or die
  9. $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
  10.  
  11. // try to login
  12. if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
  13. echo "Connected as $ftp_user@$ftp_server\n";
  14. } else {
  15. echo "Couldn't connect as $ftp_user\n";
  16. }
  17.  
  18. // close the connection
  19. ftp_close($conn_id);
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement