salut voila mon code source :
<html><head></head><body>
<?
$cs = fsockopen("udp://213.246.38.33",27019);
if (!$cs) {
echo "Le serveur est en shutdown";
}
else
{
$comand="\xff\xff\xff\xffinfo\x00";
fputs ($cs,$comand, strlen($comand));
$buffer = fread($cs, 1);
$status = socket_get_status($cs);
$buffer .= fread($cs, $status["unread_bytes"]);
$buffer = explode("\x00", $buffer);
$info["ip"] = substr($buffer[0], 5);
$info["name"] = $buffer[1];
$info["map"] = $buffer[2];
$info["mod"] = $buffer[3];
$info["game"] = $buffer[4];
$info["activeplayers"] = (strlen($buffer[5]) > 1)?ord($buffer[5][0]):"0";
$info["maxplayers"] = (strlen($buffer[5]) > 1)?ord($buffer[5][1]):"0";
return $info;
$command="\xff\xff\xff\xffplayers\x00";
fputs ($cs,$command, strlen($command));
$buffer2 = fread($cs, 1);
$buffer2 .=fread($cs, $status["unread_bytes"]);
$buffer2 = substr($buffer2, 1);
for($i = 1; strlen($buffer2) > 0; $i++)
{
$tmp = strpos($buffer2, "\x00" );
$player[$i]["name"] = substr($buffer2, 1, $tmp);
$player[$i]["frag"] = ord($buffer2[$tmp + 1]) +
(ord($buffer2[$tmp + 2]) << 8) +
(ord($buffer2[$tmp + 3]) << 16) +
(ord($buffer2[$tmp + 4]) << 24);
$tmptime = @unpack('ftime', substr($buffer2, $tmp + 5, 4));
$player[$i]["time"] = date('i:s', round($tmptime['time'], 0) + 82800);
$buffer = substr($buffer, $tmp + 9);
}
return $player;
$com="\xff\xff\xff\xffrules\x00";
fputs ($cs,$com, strlen($com));
$buffer3 = fread($cs, 1);
$buffer3 .= fread($cs, $status["unread_bytes"]);
$buffer3 = substr($buffer3, 2);
$buffer3 = explode("\x00", $buffer3);
$buffer_count = floor(sizeof($buffer3) / 2);
for($i = 0; $i < $buffer_count; $i++)
{
$rules[$buffer3[2 * $i]] = $buffer3[2 * $i + 1];
}
ksort($rules);
return $rules;
fclose($cs);
}
echo "Nom du serveur".$info["name"]."<br>";
echo "Ip :".$info["ip"]."<br>";
echo "Map :".$info["map"]."<br>";
echo "Joeurs".$info["activeplayers"]."/".$info["maxplayers"]."<br>";
echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"5\" border=\"0\"><tr><td>";
echo "<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" height=\"100%\" border=\"0\">";
echo "<tr><td><b><p class=\"mm\">Pseudo</p></b></td><td align=\"center\"><b><p class=\"mm\">Frags</p></b></td></tr>";
for($i = 1; is_array($player) && $i <= $info["activeplayers"]; $i++) {
echo "<tr><td class=\"mm\" align=\"left\">".substr($player[$i]["name"], 0, 15)."</td><td class=\"mm\" align=\"center\">".$player[$i]["frag"]."</td>";
}
echo "</table>";
echo "</td></tr></table>";
echo "<br>Autres informations sur le serveur :".$rules."<br>";
?></body></html>
le probleme etant que lorsque je charge la page rien ne s'affiche ( voir http://dknew.jexiste.fr/cs/serveurinfo.php) si vous pouriez m aider ca serai vraiment cool merci d avance a bientot