Manuel Pear

Net_FTP::connect()

Net_FTP::connect() -- connects to a given FTP server

Synopsis

  1. <?php
  2. require_once 'Net/FTP.php
  3. ?> 

mixed Net_FTP::connect ([string $host = null [, int $port = null]])

Description

Create a new object for communication with FTP servers.

Paramètres

  • string $host = null - The host to connect to ( either an IP address or a domain name). This parameter can be left out, if it has been set in the constructor or manually!

  • int $port = null - The port to connect to on the server. This parameter can be left out, if it has been set in the constructor or manually!

Valeur retournée

mixed - true on success, otherwise PEAR::Error.

Valeurs renvoyées

The returned PEAR_Error object in case of an error is unspecific. You can ignore the errornumber and errormessage, because only "Connection failed" will be returned if the connection fails.

Note

Cette fonction ne peut pas être appelée de façon statique.

Exemple

Exemple 54-1. Using connect()

  1. <?php
  2.    
  3.    $test->connect('192.168.0.1', 21);  
  4.  
  5.  
  6. ?> 

Remonter Remonter
L'éditeur javascript - CSS - Gentoo - Tutoriaux PHP - Tutoriels PHP - Bretagne - php - Moto - Kit graphique