FTP tools we have used to upload files, then in PHP, how to use code to achieve it, the following simple introduction of a most basic example, first, according to our use of FTP tools, to achieve file upload need to open the FTP tool-> input FTP address, port number, account, Password login ftp-> from the local selection of the appropriate files uploaded to the FTP directory, PHP to achieve such a simple function is nothing more.
First Step: Open FTP
$ip = "101.101.101.101";
$name = "name";
$pwd = "Mima";
$con =ftp_connect ($ip, "a") or ("Connection failed");
Step Two: Landing ftp
Ftp_login ($con, $name, $pwd);
Step three: Upload the local test.php file to the FTP image directory
Ftp_put ($con, "ittest/test.php", "test.php", ftp_ascii);
At this point in the FTP image directory can see test.php file, of course, upload files here, you can expand the upload form, the form attachment upload ftp This is more convenient, here only as a file most basic upload FTP function.