====== connect ======
{#JAPI Joomla.Framework Client JFTP::connect #}
This method makes the connection to the FTP server.
===== Syntax =====
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'. |
===== Examples =====
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:
Connection successful!