ftp_connection

Description

Constructor for the ftp_connection class.

Syntax

void ftp_connection (string $ftp_server, string $ftp_port, string $ftp_user, string $ftp_password)



Parameter $ftp_server

Expected type: String
Description: The server to connect to



Parameter $ftp_port

Expected type: String
Description: What port to connect to.



Parameter $ftp_user

Expected type: String
Description: The FTP username.



Parameter $ftp_password

Expected type: String
Description: The FTP password.


Notes

  • Example: $package_ftp = new ftp_connection('server', 21, 'username', 'password');
  • Will not work if fsockopen or fwrite are disabled.
  • Checks for valid response codes after each step.
  • Sets a 'bad_server' error and returns if the connection couldn't be opened
  • Sets a 'bad_response' error and returns if it does not receive a valid "welcome message" from the server
  • Sets a 'bad_username' error and returns if the username isn't valid
  • Sets a 'bad_password' error and returns if the password isn't valid
Advertisement: