SA-MP Forums Archive
FTP PHP Connect To SFPT - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Other (https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: FTP PHP Connect To SFPT (/showthread.php?tid=287840)



FTP PHP Connect To SFPT - Robert_Crawford - 05.10.2011

Hey guys i transfer d to a server where i only have sfpt. How can i convert the code below to work as such.

Код:
<?php
global $config;
$local_file = "dmap_feed.json";
$server_file = "/home/samp03/scriptfiles/dmap_feed.json";

$ftp_server = "REMOVED"; // Address of FTP server.
$ftp_user_name = "root"; // Username
$ftp_user_pass = "REMOVED"; // Password
#$destination_file = "C:\Documents and Settings\DraKoNSAMP\Desktop\Clan [mGo]\GAMEMODE SAMP\GM\Sourcer\scriptfiles";
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
"File Downloaded $local_file\n";
} else {
"Desculpe.Servidor Esta Desligado\n";
}
$config['api key']='ABQIAAAAs4hWYZkFgUCmji8OXGEWhRSksbxBFPegAttWA_e4E3REnVZ2ahTH-L1GBwSzV3-OuBv0_8-shNpqtQ';
$config['default script'] = 'dmap_feed.json';
$config['allow external'] = true;

?>



Re: FTP PHP Connect To SFPT - Tye Huntley - 05.10.2011

I'm not sure if this would work, but change FTP with sfpt. Might work worth the try.

Good Luck Robert.


Re: FTP PHP Connect To SFPT - Robert_Crawford - 05.10.2011

Already, tried. I also tried the "ssh2_connect" but i messed up the script on it i had to restore it.


Re: FTP PHP Connect To SFPT - Tye Huntley - 05.10.2011

Gotta hate when that happens :S


Re: FTP PHP Connect To SFPT - Robert_Crawford - 05.10.2011

figured it out what i did is as follows.
Код:
<?php
global $config;
$local_file = "dmap_feed.json";
$connection = ssh2_connect('removed', 22);
ssh2_auth_password($connection, 'username', 'password');

ssh2_scp_recv($connection, '/remotefile', '/local/file');

$config['api key']='ABQIAAAAs4hWYZkFgUCmji8OXGEWhRSksbxBFPegAttWA_e4E3REnVZ2ahTH-L1GBwSzV3-OuBv0_8-shNpqtQ';
$config['default script'] = 'dmap_feed.json';
$config['allow external'] = true;

?>



Re: FTP PHP Connect To SFPT - BlazeFury - 05.10.2011

Quote:
Originally Posted by Robert_Crawford
Посмотреть сообщение
figured it out what i did is as follows.
Код:
<?php
global $config;
$local_file = "dmap_feed.json";
$connection = ssh2_connect('removed', 22);
ssh2_auth_password($connection, 'username', 'password');

ssh2_scp_recv($connection, '/remotefile', '/local/file');

$config['api key']='ABQIAAAAs4hWYZkFgUCmji8OXGEWhRSksbxBFPegAttWA_e4E3REnVZ2ahTH-L1GBwSzV3-OuBv0_8-shNpqtQ';
$config['default script'] = 'dmap_feed.json';
$config['allow external'] = true;

?>
Cheers


Re: FTP PHP Connect To SFPT - Mrkrabz - 05.10.2011

If you could define the port with the first script, you could have just changed it to 22.