I am using the PHP script below to test FTP connections. Currently it is printing an array of the files, if it successfully connects.
How can I get it to also display
Hello I have tried this..Working properly.
set_time_limit(300);//for setting
$path='/'.date('dmY').'';
$ftp_server='';
$ftp_server_port="";
$ftp_user_name='';
$ftp_user_pass="";
// set up a connection to ftp server
$conn_id = ftp_connect($ftp_server, $ftp_server_port);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// check connection and login result
if ((!$conn_id) || (!$login_result)) {
echo "Fail";
} else {
echo "Success";
// enabling passive mode
ftp_pasv( $conn_id, true );
// get contents of the current directory
$contents = ftp_nlist($conn_id, $path);
// output $contents
var_dump($contents);
}
// close the FTP connection
ftp_close($conn_id);