Please check your FTP Host and try again.'; return $trouble; } $result = ftp_login( $conn, $user, $pass ); if ( ! $result ) { $trouble = 'I could connect to the FTP server but I could not log in.
Please check your credentials and try again.'; return $trouble; } $success = ftp_chdir( $conn, $subdir ); if ( ! $success ) { $trouble = 'I can connect to the FTP server, but I cannot change into the FTP subdirectory you specified.
Is the path correct? Does the directory exist? Is it wrritable?
Please check using an FTP client like FileZilla.'; return $trouble; } $trouble = 'OK'; // Lose this connection. ftp_close( $conn ); return $trouble; }