All pastes #490632 Raw Edit

Someone

public php v1 · immutable
·published 2007-05-16 03:51 UTC
rendered paste body
<?if (extension_loaded('zlib')) @ob_start('ob_gzhandler');@header("Expires: Mon, 26 Jul 1995 05:00:00 GMT");@header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");@header("Cache-Control: no-cache, must-revalidate");@header("Pragma: no-cache");function check_record($current) {    $fp = fopen("record.txt", "r+b");    $record = fread($fp, 10);    if ($record >= $current) return $record;    rewind($fp);    ftruncate($fp, '0');    fwrite($fp, $current);    return $current;}?><html><head><title>Zone Status</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><TABLE width="100%" height="100%" align="left" border="0" cellPadding="2" cellSpacing="0">    <TBODY>      <TR class="cattitle">        <TD valign="top"> <table width="100%" cellpadding="0" cellspacing="0">          <tr class="td3d">            <td width="95%" align="left"><b><FONT COLOR="black">Zone</b></td>            <td valign="top" width="94%" align="center"><FONT COLOR="black">#</td>          </tr>          <?$total_online = 0;$zones = array();//"Zonename/ipaddress/port", (for you me5 =P)$servers = array("Pedoland/pedo.pedo.pedo.pedo/1337",);foreach ($servers as $server) {    $info = explode("/", $server);    if ($handle = fsockopen('udp://'.$info[1], $info[2])) {        socket_set_timeout($handle, 1);        $request = pack("CCCC", 0xB2, 0x6F, 0xA0, 0x00);        fwrite($handle, $request);        $online = fread($handle, 4);        if (empty($online)) continue;        $online = unpack('S', $online);        $online = implode($online);        $total_online += $online;	  $zones[] = array("Online" => $online, "Name" => $info[0]);        fclose($handle);    }}$record = check_record($total_online, 'record.txt');asort($zones, SORT_NUMERIC);arsort($zones);foreach ($zones as $zone) { ?>          <tr class='td3d'>            <td align='left' width='100%'>			<FONT COLOR="black">			              <?=$zone['Name'];?>			  &nbsp;			  &nbsp;			  &nbsp;            </td>            <td width='100%' align='right'><font color="green">              <?=$zone['Online'];?></font></td>          </tr>          <?}?><FONT COLOR="blue">          <tr class='td3d'>            <td colspan='2' align='center'>&nbsp;</td>          </tr>          <tr class='td3d'>            <td colspan='2' align='center'><FONT COLOR="black">Online:              <?=$total_online;?>            </td>          </tr>          <tr class='td3d'>            <td colspan='2' align='center'><FONT COLOR="black">Record:              <? include "record.txt"; ?>            </td>          </tr>          <tr class='td3d'>            <td colspan='2' align='center'>            &nbsp;            </td>          </tr>          <tr class='td3d'>            <td colspan='2' align='center'>            <a href='index.php' title='Refresh'><FONT COLOR="black">[Refresh]</a>            </td>          </tr>        </table></TD>      </TR></TABLE><p>&nbsp;</p></body></html><br><br>