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 a message, if it is able to connect? Like 'Connection Successful'.

$con = ftp_connect($server) or die("Couldn't connect"); 
ftp_login($con,  $username,  $password);
print_r(ftp_nlist($con, "."));
ftp_close($con);

EDIT

I have it working now but, I've tested this on a few domains I have on a MediaTemple server and they all seem be timing out. Yet, it works with all other domains I have tried. Are their servers blocking the request?

Edit
Report