시간 설정, 시간 오차...
본문
<?php if ($w == "u"): ?>
<input type="hidden" name="wr_10" value="<?= $write['wr_10'] ?>">
<?php endif; ?>
<!-- 자폭 부분 -->
<?php if ($w == ""): ?>
<tr>
<td style='padding-left:50px; height:30px;'>· 자폭설정</td>
<td>
<input type="checkbox" name="bcheck" value="checkbox" onclick="chk1(this);">
<select name="wr_10" style="FONT-SIZE: 9pt" onchange="doIt(this.value)">
<option value="" selected>자폭안함</option>
<option value="<?= date('Y-m-d H:i:s', strtotime('+30 seconds')) ?>">30초 후</option>
<option value="<?= date('Y-m-d H:i:s', strtotime('+60 seconds')) ?>">60초 후</option>
<option value="<?= date('Y-m-d H:i:s', strtotime('+300 seconds')) ?>">5분 후</option>
<option value="<?= date('Y-m-d H:i:s', strtotime('+600 seconds')) ?>">10분 후</option>
<option value="<?= date('Y-m-d H:i:s', strtotime('+3600 seconds')) ?>">1시간 후</option>
<option value="<?= date('Y-m-d H:i:s', strtotime('+86400 seconds')) ?>">24시간 후</option>
</select>
<div id="mytext" class="redtext" style="display:inline" onclick="changeclass(this,'hi')">자동 폭파 사용 안함</div>
</td>
</tr>
<tr><td colspan="2" height="1" bgcolor="#e7e7e7"></td></tr>
<?php endif; ?>
해당 소스는 게시물을 자폭하기 위한 소스입니다.
$BombDay = "<a href=\"javascript:alert('자폭 설정이 되어 있습니다.\\n자폭일 : ".$view[wr_10]."')\"><font color=red class=small>(자폭 설정이 작동 중입니다. 지정일: $bombdate)</font></a><br>";
보면 wr_10으로 시간을 저장하고 있는데...
문제는 시간 격차가 많이 발생합니다.
가령 30초를 선택하고, 제가 직접 새로고침을 연달아 누르고 있는 상태임에도
1분이 넘어서 작동하기도 하고 그러네요...
이 시간 격차 어떻게 수정하면 될까요?
참고로 php시간, 리눅스 시간 모두 서울라 맞춰둔 상태입니다..
답변 2
자폭을 처리하는 부분의 소스가 있어야 할 것 같구요.
php 시간과 리눅스 시간의 오차는 없는지 실시간을 비교해보시구요.
30초를 선택하면 저장할때 시간 기준의 30초가 되야하지 않을까요?
지금은 설정하는 화면이 보여질때 기준이라 선택하고 저장하는데 몇초가 흐를수도 있겠습니다.
$stoday $bombdate7 이 두 값을 화면에 나오도록 하고
새로고침 하면서 둘 중 어디에 문제가 있는지 확인해 보세요~