
September 8th, 2003, 06:32 AM
|
|
Contributing User
|
|
Join Date: Jun 2003
Posts: 219
Time spent in forums: 16 h 59 m 48 sec
Reputation Power: 6
|
|
|
FTP_TIMEOUT_SEC usage
Am trying to work with php's ftp commands and setting a shorter timeout for its connection.. so if it cant connect users wont have to wait 90 seconds before they can continue
now Im using it like they said on php.net I just dont understand where exacly to put it.. Ive tried it before and after defining $conn_id, like this:
PHP Code:
$conn_id = @ftp_connect($ip,$port);
ftp_set_option($conn_id, FTP_TIMEOUT_SEC, 10);
or
PHP Code:
ftp_set_option($conn_id, FTP_TIMEOUT_SEC, 10);
$conn_id = @ftp_connect($ip,$port);
in both cases I get an error saying:
Warning: ftp_set_option() expects parameter 1 to be resource, null given in /home/sc0rp/public_html/test/ftp.php on line 19
line 19 is of cuz:
ftp_set_option($conn_id, FTP_TIMEOUT_SEC, 10);
is there anyone who can help me with this 
|