[jQuery] JSON 실시간 페이지 가져오기
본문
<script>
$(document).ready(loadCounter);
function loadCounter() {
$(
"#member"
).load(
"./some.php"
, { count:1 },
function(responseText, textStatus, XMLHttpRequest) {
setTimeout(loadCounter, 5000);
// 1초(1000)
});
}
</script>
<
div
id=
"member"
></
div
>
some.php
<?php
include_once('./_common.php');
$sql3 = " select count(*) as cnt from {$g5['test_table']} where mb_id = '{$member['mb_id']}' and bo_table = '{$bo_table}' and wr_id = '{$wr_id}' ";
$row3 = sql_fetch($sql3);
if(!$row3['cnt']) {
$sql = " insert into {$g5['test_table']}
set mb_id = '{$member['mb_id']}',
bo_table = '{$bo_table}',
wr_id = '{$wr_id}' ";
sql_query($sql);
sql_query(" update {$g5['member_table']} set mb_10 = mb_10 + 1 where mb_id = '{$member['mb_id']}' ");
}
?>
추천0
댓글목록 0
등록된 댓글이 없습니다.