<p><span style="color: #404040; font-family: 굴림;">1. 서버푸시를 사용할 수 밖에 없었던 이유는...&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">많은 내용을 계속 실시간으로 보여 줘야 되는데, 리플레쉬는 너무 딸그락, 껌뻑~~ ,&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">마우스 커서의 변화... 짜증남... ^^;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">2. 그러나 문제점 발생&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">한 페이지 가득인 테이블의 내용을 갱신하기에는 푸시도 껌뻑~~&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">3. 꽁수 부리기&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">리플레쉬 처럼 프레임으로 나누고 히든으로 한다음, 자바스크립트가 필요한 부분을 뿌리게 끔 했습니다.&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">히든 프레임 : push&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">내용 프레임 : main 라고 하면....&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">테이블에서 내용이 나올 부분은 &lt;INPUT&gt;을 이용하였습니다.&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">갱신되는 내용은 push 프레임에 자바스크립트로 씌여지고,&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">여기의 자바스크립트가 main 프레임의 &lt;INPUT&gt;에 내용을 씁니다.&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">이렇게 하니까... 필요한것만 바뀌어서, 아주 보기가 좋더군요...&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">버벅 되지 않고, 딸깍 소리도 없고, 쉽게 구현되고......&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">update.data의 내용을 갱신하면 최대 sleep()에 설정된 시간후에&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">웹페이지가 갱신됨...&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">실제 이용할때는 update.data라는 파일은 서버에서 자동으로 갱신 해주면 됨...&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">4. 소스 보기&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">----&lt; index.html &gt;---------&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;HTML&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;HEAD&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;FRAMESET rows="0,*" border=0 frameborder=0 framespacing=0 noresize&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &lt;FRAME name="push" src="push.php" scrolling=no noresize&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &lt;FRAME name="main" src="main.php" scrolling=auto noresize&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;/FRAMESET&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;/HEAD&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;/HTML&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">----&lt; main.php &gt;-----------&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;HTML&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;HEAD&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &lt;TITLE&gt;PUSH 테스트&lt;/TITLE&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &lt;META http-equiv="Content-Type" content="text/html; charset=euc-kr"&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;/HEAD&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;BODY&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;H2&gt;빵야아찌가 좋아하는 여자 연예인 베스트 5 ㅡ.ㅡ;;&lt;/H2&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;FORM name="pushform"&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;TABLE border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111"&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &lt;TR&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &lt;TD align="center"&gt;&lt;B&gt;NO.&lt;/b&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &lt;TD align="center"&gt;&lt;B&gt;이름&lt;/b&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &lt;TD align="center"&gt;&lt;B&gt;키&lt;/b&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &lt;TD align="center"&gt;&lt;B&gt;몸무게&lt;/b&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &lt;/TR&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;?&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">for( $i=1;$i&lt;=5;$i++ )&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">{&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; echo "&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &lt;TR&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &lt;TD align="center"&gt;&lt;B&gt;$i&lt;/B&gt;&lt;/TD&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &lt;TD align="center"&gt;&lt;INPUT type=text name="name_$i" size=8&gt;&lt;/TD&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &lt;TD align="center"&gt;&lt;INPUT type=text name="height_$i" size=4&gt;&lt;/TD&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &lt;TD align="center"&gt;&lt;INPUT type=text name="weight_$i" size=4&gt;&lt;/TD&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &lt;/TR&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; ";&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">}&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">?&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;/TABLE&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;/FORM&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;/BODY&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;/HTML&gt;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">----&lt; update.data &gt;--------&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">옥주현@</span><a href="mailto:173@55" style="text-decoration-line: none; color: #3a4e40; font-family: 굴림;" target="_blank">173@55</a><span style="color: #404040; font-family: 굴림;">&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">송혜교@</span><a href="mailto:161@45" style="text-decoration-line: none; color: #3a4e40; font-family: 굴림;" target="_blank">161@45</a><span style="color: #404040; font-family: 굴림;">&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">김하늘@</span><a href="mailto:167@45" style="text-decoration-line: none; color: #3a4e40; font-family: 굴림;" target="_blank">167@45</a><span style="color: #404040; font-family: 굴림;">&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">배두나@</span><a href="mailto:168@50" style="text-decoration-line: none; color: #3a4e40; font-family: 굴림;" target="_blank">168@50</a><span style="color: #404040; font-family: 굴림;">&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">김남주@</span><a href="mailto:169@48" style="text-decoration-line: none; color: #3a4e40; font-family: 굴림;" target="_blank">169@48</a><span style="color: #404040; font-family: 굴림;">&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">----&lt; push.php &gt;-----------&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&lt;?&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">function push()&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">{&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; $fp = fopen( "./update.data", "r" );&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; echo "&lt;script language="javascript"&gt;n";&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; echo "&lt;!--n";&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; for( $i=1;$i&lt;=5;$i++)&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; {&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &nbsp; &nbsp; $buff = fgets( $fp, 1024 );&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &nbsp; &nbsp; $buff = trim( $buff );&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &nbsp; &nbsp; $array = explode( "@", $buff );&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &nbsp; &nbsp; echo "parent.main.document.pushform.name_$i.value = "$array[0]";n";&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &nbsp; &nbsp; echo "parent.main.document.pushform.height_$i.value = "$array[1]";n";&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &nbsp; &nbsp; echo "parent.main.document.pushform.weight_$i.value = "$array[2]";nn";&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; }&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; echo "self.status = "10초에 한번씩 자료를 업데이트 합니다. 서버푸시를 사용하였습니다.";n"; // 이걸 넣어주면, 연결중이라는 보기안좋은 메시지를 가릴수가 있지요..&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; echo "--&gt;n";&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; echo "&lt;/script&gt;n";&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; fclose( $fp );&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">}&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">sleep( 1 ); // main 프레임의 테이블보다 먼저 불려지면 오류가 뜨기 때문에...&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">while(1)&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">{&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; push();&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; flush();&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; sleep( 10 ); // 10초에 한번씩 갱신...&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">}&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">?&gt;</span></p>