Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $conn_id = ftp_connect($ftp_server);
- ftp_pasv($conn_id, TRUE);
- // login with username and password
- $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
- $okk=0;
- // try to download $server_file and save to $local_file
- if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) (line 31)
- {
- $okk=1;
- }
- <?php
- $ftp_server = $ftp_server;
- $ftp_user = $ftp_user_name;
- $ftp_pass = $ftp_user_pass;
- // set up a connection or die
- $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
- // try to login
- if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
- echo "Connected as $ftp_user@$ftp_servern";
- if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY))
- {
- $okk=1;
- }
- } else {
- echo "Couldn't connect as $ftp_usern";
- }
- // close the connection
- ftp_close($conn_id);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement