웹마스터 팁

http://www.kaillera.com에뮬 멀티할때 접속하는 카일레라 서버의 상태 페이지를 만들어 봅시다. 'w'
카일레라 서버는 링크1에 있습니다.
--------------------------------------------------------------------
<pre>
<?php
  $_ip="192.168.0.1:27888"; // 자신의 ip와 포트 번호로 수정합니다.

  $file=@file("http://".$_ip."/?page=status");
  if($file) {
    echo "서버 상태(status): <font color=blue>가동중.(online)</font>nn";
    $uptime=$file[3]; $uptime=str_replace("uptime:","",$uptime);
    $uptime=str_replace("seconds","",$uptime); $uptime=trim($uptime);

    $stamp=explode(".",$uptime);

    $days=(int)($stamp[0]/86400);
    $stamp[0]-=$days*86400;
    $hrs=(int)($stamp[0]/3600);
    $stamp[0]-=$hrs*3600;
    $mins=(int)($stamp[0]/60);
    $stamp[0]-=$mins*60;
    $secs=(int)($stamp[0]);

    echo "가동 시간(uptime): ".$days." days ".$hrs." hours ".$mins." min ".$secs." secs ".$stamp[1]." microsecs.n";

    $clients=$file[5]; $clients=trim(str_replace("# clients:","",$clients));
    echo "접속자(clients): ".$clients." 명n";

    $games=$file[6]; $games=trim(str_replace("# games:","",$games));
    echo "개설된 게임(games): ".$games." 개n";

    echo"</pre>n<table border=1 bordercolor=black cellpadding=3 cellspacing=0>n";
    echo"<caption><font size=3 face="Tahoma"><b>Client List</b></font></caption>n";
    echo"<tr><th>No</th><th>Name</th><th>Client</th><th>Connection</th><th>Status</th></tr>n";
    for($i=10;$i<$clients+10;$i++) {
      $j++;
      $temp=explode("t",$file[$i]);
      echo"<tr><td> ".$j." </td><td> ".$temp[0]." </td><td> ".$temp[1]." </td><td> ".$temp[2]." </td><td> ".$temp[3]." </td></tr>n";
    } $j=0;

    echo"</table>n<table border=1 bordercolor=black cellpadding=3 cellspacing=0>n";
    echo"<caption><font size=3 face="Tahoma"><b>Games List</b></font></caption>n";
    echo"<tr><th>No</th><th>Title</th><th>Users</th><th>Status</th></tr>n";

    for($i=$clients+13;$i<$clients+13+$games;$i++) {
      $j++;
      $temp=explode("t",$file[$i]);
      echo"<tr><td>".$j."</td><td>".$temp[0]."</td><td>".$temp[1]."</td><td>".$temp[2]."</td></tr>n";
    }
    echo"</table>";
  } else echo"서버 상태(status): <font color=red>정지.(offline)</font>n</pre>";
?>

제목 글쓴이 날짜
최근게시물의 폰트크기와 링크색상 바꾸기. [5] 매머드 2002.09.13
레이어 고정법 [8] bageup 2002.09.11
자바스크립트 없이 브라우저 버전체크 [5] steelheart 2002.09.03
초보에게는 골치아픈 배경 위치 정하기... [6] 유지호 2002.09.01
[HTML 초보자] 테이블 태그를하자-1 [5] ZipShin 2002.08.30
스타일 시트 적용순서 [4] 판타랏사 2002.08.24
[HTML 초보자] HTML <Hr>태그에 대해서.. [3] ZipShin 2002.08.23
노프레임 홈페이지 만들기 강좌:) [53] file Alunar@R. 2002.08.22
[HTML 초보자] 강제개행 <br>태그 엔터효과. [8] ZipShin 2002.08.21
HTML과 CSS 사전을 만들어 보았습니다. [7] 01CODE.com 2002.08.20
[초보-하드코딩] 소스정리 팁 몇가지... [23] 안데르센 2002.08.19
[HTML 초보자] HTML 문단 P태그에 대해서 알아봐요..^^ [5] ZipShin 2002.08.18
[HTML 초보자] HTML HeadLine태그(H1,H2..) [6] ZipShin 2002.08.16
깔끔한 홈페이지를 만들고 싶다면 꼭 알아야 할 것(2) [9] 키르(SP) 2002.08.15
깔끔한 홈페이지를 만들고 싶다면 꼭 알아야 할 것(1) [5] 키르(SP) 2002.08.15
[HTML 초보자] HTML 물리적태그와 논리적태그(글자진하게 등등) [5] ZipShin 2002.08.14
[Siren]소스보기 금지된 페이지 저장하기! (강좌가 아닌가..;;) [15] 세이렌 2002.08.12
[HTML 초보자] HTML 폰트 태그 [2] ZipShin 2002.08.12
[HTML 초보자] HTML 홈페이지의 태그 기본구조2. [13] ZipShin 2002.08.09
중간 점 찍기 [12] 오픈소스 2002.08.08