Jump to content

Archived

This topic is now archived and is closed to further replies.

tcostello

ftp_close() undefined

Recommended Posts

I am using php_ftp to get the last modified-date of a file on a foriegn server. I can create the ftp connection, but I cannot close the connection. Do I have to do something to the PHP configuration file? I am running PHP 4.1.2 on Apache 1.3.26

The error I get is:

Fatal error: Call to undefined function: ftp_close() in foo/bar/foo.php on line 66

My code is below:

<?

function get_date($filename){

$ftp_server = server;
$ftp_user_name = user;
$ftp_user_pass = pass;

$conn_id = ftp_connect($ftp_server);

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);


// check connection

if ((!$conn_id) || (!$login_result)) {
echo "ERROR!<BR>";
exit;
}
ftp_close($conn_id); //if this function is left in the script I get the "fatal error."

return ftp_mdtm($conn_id, $filename);

}



?>

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.