Upload a file to an FTP server.
$ftp_server = "www.domain.com"; // FTP hostname$ftp_user_name = "user"; // FTP username$ftp_user_pass = "pass"; // FTP password$ftp_path = "/htdocs/backup/"; // FTP path to upload to
$filename = "text.sql";
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
ftp_pasv ( $conn_id, true );
$upload = ftp_put($conn_id, $ftp_path.$filename, $filename, FTP_BINARY);