하루에 한개IP당글을 5개만 올리수있게 하고 싶습니다.
아래는 하루에 한개 회원이 5개만 쓸수 있는건데 여기에 한개IP당 한개회원 하루에 5개만 글쓸수있게 하고싶습니다.
고수님 도와주세요 감사 합니다
if ($w != 'u') {
$sql = " select count(*) as cnt from $write_table where mb_id='$member[mb_id]' and datediff(LEFT(wr_datetime, 10) , CURDATE()) = 0 AND wr_is_comment ='0' GROUP BY mb_id having count(*) >= 5 ";
$row = sql_fetch($sql);
if ($row[cnt] ) {
alert("이 게시판에 하루에 5개의 글만 쓸 수 있습니다.");
}
}
답변 2개
$sql = "
select count(*) as cnt
from $write_table
where wr_ip = '{$_SERVER['REMOTE_ADDR']}'
and datediff(LEFT(wr_datetime, 10) , CURDATE()) = 0
and wr_is_comment ='0'
group by mb_id having count(*) >= 5
";
select count(*) as cnt from $write_table where mb_id='$member[mb_id]' and wr_ip='{$_SERVER['REMOTE_ADDR']}' and datediff(LEFT(wr_datetime, 10) , CURDATE()) = 0 AND wr_is_comment ='0' GROUP BY mb_id having count(*) >= 5
쿼리 부분을 게시판에 등록시 이런식으로 체크 처리하시면 가능할듯 합니다.
답변을 작성하려면 로그인이 필요합니다.