Jump to content

ftp_close() undefined


tcostello

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);

}



?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.