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
https://forums.phpfreaks.com/topic/4270-ftp_close-undefined/
Share on other sites

Archived

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

×
×
  • 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.