Nejste přihlášeni
Stránky 1
Dobrý den,
můj php skript pro zjištování stavu (online/offline) serveru bohužel u Vás nefunguje. Prosím o radu, Děkuji.
http://games.free-servers.eu/la2/cz/status-lineage.php
Offline
Jestli neni problem v tom ze promena $domain je prazdna?
Offline
Proměná je $server = "IP serveru"; , tu mám doplněnou. Na předchozím hostingu (profitux.cz) byl skript funkční bez problémů.
Mohu zaslat skript pomocí PM.
Offline
ja psal promena $domain .
Offline
Vkládám přímo skript. Tento TOTOŽNÝ skript bezproblémově funguje na dvou mých placených hostingzích bez problému.
<?php
$server = "93.190.51.71";
$port = "2106";function pingDomain($server){
$starttime = microtime(true);//Server 1 Port
$file = fsockopen ($domain, 2106, $errno, $errstr, 10);
$stoptime = microtime(true);
$status = 0;if (!$file) $status = -1;
else {
fclose($file);
$status = ($stoptime - $starttime) * 1000;
$status = floor($status);
}
return $status;
}$status = pingDomain($serverbase);
if ($status <= 50) $MessageStatus = "";
elseif ($status <= 80) $MessageStatus = "";
elseif ($status <= 150) $MessageStatus = "";
else $MessageStatus = "";$upmessage = "<font size='1' color='white'> </font><font color='gray'
size='1'>$MessageStatus</font>";
$downmessage = "<font size='1' color='white'> </font><font color='gray'size='1'></font>";
$tout = "5";
$server1 = @fsockopen ($server, $port, $errno, $errstr, $tout);
if(!$server1){ echo"<b><font color='black' size='2' style='Arial'>Lineage 2</font></b><br><font color='black' size='2' style='Arial'>Login </font><fontsize='1' color='white'></font><font color='red' size='2' style='Arial'><strong> Off-line</strong></font><br>$downmessage"; }
else { echo"<b><font color='black' size='2' style='Arial'>Lineage 2</font></b><br><font color='black' size='2' style='Arial'>Login </font><font size='1'color='white'></font><font color='green' size='2' style='Arial'><strong> On-line</strong></font><br>$upmessage"; }
$server2 = "93.190.51.71";
$port2 = "7777";function pingDomain2($server2){
$starttime2 = microtime(true);//Server 2 Port
$file2 = fsockopen ($domain2, 7777, $errno, $errstr, 10);
$stoptime2 = microtime(true);
$status2 = 0;if (!$file2) $status2 = -1;
else {
fclose($file2);
$status2 = ($stoptime2 - $starttime2) * 1000;
$status2 = floor($status2);
}
}$status2 = pingDomain($serverbase2);
if ($status2 <= 50) $MessageStatus2 = "";
elseif ($status2 <= 80) $MessageStatus2 = "";
elseif ($status2 <= 150) $MessageStatus2 = "";
else $MessageStatus2 = "";$upmessage2 = "<font size='1' color='white'> </font><font color='gray'
size='1'>$MessageStatus2</font>";
$downmessage2 = "<font size='1' color='white'></font><font color='gray'size='1'></font>";
$tout = "5";
$server2 = @fsockopen ($server2, $port2, $errno, $errstr, $tout);
if(!$server2){ echo"<font color='black' size='2'style='Arial'> Game 25x</font><font size='1' color='white'></font><font
color='red' size='2' style='Arial'><strong> Off-line</strong></font><br>$downmessage2"; }
else { echo"<font color='black' size='2' style='Arial'> Game 25x</font><fontsize='1' color='white'></font><font color='green' size='2' style='Arial'><strong> On-line</strong></font><br>$upmessage2"; }
?>
Offline
Hmm tak znovu
ve skriptu pouzivate promennou $domain viz
$file = fsockopen ($domain, 2106, $errno, $errstr, 10);
ta dle meho ale neni nadefinovana proto to hlasi ten warning
Warning: fsockopen() [function.fsockopen]: unable to connect to :2106 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /home/users/fseu/free-servers.eu/web/games/la2/cz/status-lineage.php on line 8
diky tomu ze neni promenna vyplnena tak se skript snazi pripojit na IP "2106"
pokud vam to jinde funguje tak mi bud neco unika, nebo tam jen neni zapnuto vypisovani warningu )
Offline
Stránky 1