| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Client |
JFTP |
connect |
connect() |
Never | Work in Progress |
This method makes the connection to the FTP server.
boolean connect ( $host, $port )
| $host | string | is a string containing the host to connect to. This parameter is optional and if omitted, defaults to ‘127.0.0.1’. |
| $port | string | is a string containing the port to connect to. This parameter is optional and if omitted defaults to ‘21’. |
Example
jimport( 'joomla.connector.ftp' ); $ftp = new JFTP( array( 'type' => FTP_BINARY ) ); if ($ftp->connect( 'ftp.ftpserver.com' )) { echo "Connection successful!"; } else { echo "Connection failed!"; }
might produce:
Result
Connection successful!