<?php //GetBans //October 11th/2009 //Retrieves the samp banlist from your server and echos it back in a neat fashion. $ftp_host = "***"; //put the ip / hostname to your ftp here $ftp_user = "***"; //put your login here $ftp_pass = "***"; //put your password here $banfile = "samp.ban"; $con = ftp_connect($ftp_host) or die("Couldnt connect to your ftp (check your settings!"); ftp_login($con, $ftp_user, $ftp_pass); ftp_get($con, "ban.txt", $banfile, FTP_ASCII) or die("failed"); ftp_close($con); $file = fopen("ban.txt", "r"); $bans = fread($file, filesize("ban.txt")); fclose($file); echo nl2br($bans); ?>
ftp_get($con, "ban.txt", $banfile, FTP_ASCII) or die("failed");
<?php
//GetBans
//October 11th/2009
//Retrieves the samp banlist from your server and echos it back in a neat fashion.
$ftp_host = "***"; //put the ip / hostname to your ftp here
$ftp_user = "***"; //put your login here
$ftp_pass = "***"; //put your password here
$banfile = "samp.ban";
$con = ftp_connect($ftp_host) or die("Couldnt connect to your ftp (check your settings!");
ftp_login($con, $ftp_user, $ftp_pass);
ftp_get($con, "samp.ban", $banfile, FTP_ASCII) or die("No se puede obtener el archivo");
ftp_close($con);
rename("$banfile","samp.txt");
$file = fopen("samp.txt", "r");
$bans = fread($file, filesize("samp.txt"));
fclose($file);
echo nl2br($bans);
?>
Proba asн:
PHP код:
|
<?php
//GetBans
//October 11th/2009
//Retrieves the samp banlist from your server and echos it back in a neat fashion.
$ftp_host = "***"; //put the ip / hostname to your ftp here
$ftp_user = "***"; //put your login here
$ftp_pass = "***"; //put your password here
$banfile = "samp.ban";
$con = ftp_connect($ftp_host) or die("Couldnt connect to your ftp (check your settings!");
ftp_login($con, $ftp_user, $ftp_pass);
if (ftp_get($con, "samp.ban", $banfile, FTP_BINARY)) {
echo "Se ha guardado satisfactoriamente en $local_file\n";
} else {
echo "Ha habido un problema\n";
}
ftp_close($con);
rename("$banfile","samp.txt");
$file = fopen("samp.txt", "r");
$bans = fread($file, filesize("samp.txt"));
fclose($file);
echo nl2br($bans);
?>