Created
June 5, 2013 14:43
-
-
Save szmeku/5714367 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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