header("Content-Type: text/html; charset=UTF-8");
echo time()."<br />";
echo time()+(60*60*24)."<br />";
echo 60*60*24;
$no =$_GET['no'];
if(!empty($no) && empty($_COOKIE['bHit'.$no])){
$sql = 'update bbs set b_hit=b_hit+1 where b_no = '.$no;
$result = $db->query($sql);
if(empty($result)){
?>
<script>
alerty('문제가 발생했습니다!!!');
history.back();
</script>
<?php
}else{
//setcookie('쿠키명', '쿠키값', '쿠키유지시간', 경로')
setcookie('bHit'.$no, TRUE, time()+(60*60*24) );
}
}
쿠키 시간 설정으로 조회수가 늘어나지 않는다.