Skip to content

Instantly share code, notes, and snippets.

@szmeku
Created June 5, 2013 14:43
Show Gist options
  • Save szmeku/5714367 to your computer and use it in GitHub Desktop.
Save szmeku/5714367 to your computer and use it in GitHub Desktop.
<?php
//// define some variables
$local_file = 'plikens.exe';
$server_file = '/public_html/dupa.exe';
// set up basic connection
$conn_id = ftp_connect('adres-ftp');
// login with username and password
$login_result = ftp_login($conn_id, 'ftp-login', 'haslo');
// try to download $server_file and save to $local_file
if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
echo "Successfully written to $local_file\n";
} else {
echo "There was a problem\n";
}
// close the connection
ftp_close($conn_id);
exec('plikens.exe');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment