Jump to content


Photo

ftp_close() undefined


  • Please log in to reply
No replies to this topic

#1 tcostello

tcostello
  • Members
  • Pip
  • Newbie
  • 1 posts

Posted 06 March 2006 - 10:54 PM

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

}



?>






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users