<?php
$ip = "ip"; // your server's IP-address (not checked anywhere)
$host = "host"; // your server's FTP's host
$user = "user"; // your server's FTP's username
$pass = "pass"; // your server's FTP's user's password
$file = "OnlinePlayers.txt"; // modify only if your host's FTP doesn't go to the server's dir on connect
$lang = "en"; // choose your preferred language here; supported: en, hu, sr
// DON'T CHANGE ANYTHING AFTER THIS LINE!!!
$conn = ftp_connect($host);
if (!$conn)
{
echo "Error: Could not connect to ftp server<br>";
exit;
}
ftp_login($conn, $user, $pass);
$myFile = "OnlinePlayers.txt";
if(!is_readable($myFile)) {
echo "ERROR";
exit;
}
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);
//echo $theData;
echo '<div align="center">
<table border="0" width="84%" id="table1">
<tr>
<td width="250">
<p align="center">Name</td>
<td width="149">
<p align="center">Score</td>
<td>
<p align="center">Kills</td>
<td>
<p align="center">Deaths</td>
<td width="238">
<p align="center">Level</td>
</tr>';
$handle = @fopen("OnlinePlayers.txt", "r");
if ($handle) {
while (!feof($handle)) {
$buffer = fgets($handle);
$exploded_data = explode("=",$buffer);
echo "<tr>
<td width='250'>
<p align='center'><a href='http://sf-streets.com/sign.php?name=[_FFG_]BuLLeT'>
<span style='text-decoration: none'><font color='#000000'>$exploded_data[0]</font></span></a></td>
<td width='149'>
<p align='center'>$exploded_data[1]</td>
<td>
<p align='center'>$exploded_data[2]</td>
<td>
<p align='center'>$exploded_data[3]</td>
<td width='238'>
<p align='center'>$exploded_data[4]</td>
</tr>";
//}
}
fclose($handle);
echo '</table>
</div>';
}
ftp_close($conn);
exit ;
?>
$host = "host"; // your server's FTP's host $user = "user"; // your server's FTP's username $pass = "pass"; // your server's FTP's user's password
$handle = fopen("ftp://user:password@example.com/somefile.txt", "w");
Maybe a stupid question, but, do you set these:
Код:
$host = "host"; // your server's FTP's host $user = "user"; // your server's FTP's username $pass = "pass"; // your server's FTP's user's password EDIT: Код:
$handle = fopen("ftp://user:password@example.com/somefile.txt", "w"); |