Connect to the FTP server with PHP.

/*******************************************************
*     MYCPLUS Sample Code - https://www.mycplus.com     *
*                                                     *
*   This code is made available as a service to our   *
*      visitors and is provided strictly for the      *
*               purpose of illustration.              *
*                                                     *
* Please direct all inquiries to saqib at mycplus.com *
*******************************************************/



ftp_connect


\n");
		exit();
	}

	print("Connected.
\n"); //log in if(!ftp_login($ftp, "anonymous", "[email protected]")) { print("Unable to login!
\n"); exit(); } print("Logged In.
\n"); //print system type print("System Type: " . ftp_systype($ftp) . "
\n"); //make sure passive mode is off ftp_pasv($ftp, FALSE); //get working directory print("Working Directory: " . ftp_pwd($ftp) . "
\n"); //get files in raw format print("Raw List:
\n"); foreach(ftp_rawlist($ftp, ".") as $line) { print("$line
\n"); } print("
\n"); //move to pub directory if(!ftp_chdir($ftp, "pub")) { print("Unable to go to the pub directory!
\n"); } print("Moved to pub directory.
\n"); //get a list of files print("Files:
\n"); foreach(ftp_nlist($ftp, ".") as $filename) { print("$filename
\n"); } print("
\n"); //return to root directory if(!ftp_cdup($ftp)) { print("Failed to move up a directory!
\n"); } //close connection ftp_quit($ftp); ?>