미채택 완료

추천 버튼 제한 소스 오류 good.php

2019-05-27 (월) 13:37:18 3,689
Copy
if ($good == "good") {

    $sql = " select count(*) as cnt from {$g5['board_good_table']} where bo_table = '{$bo_table}' and mb_id = '{$member['mb_id']}' and substr(bg_datetime,1,10) ='".G5_TIME_YMD."' "; 
    $tm1 = sql_fetch($sql);  

if ($tm1['cnt'] >= 5) 
        alert("추천은 하루에 5번만 가능합니다.");
    

else

$status = "추천"; 

insert_point($write[mb_id], 200, $member['mb_nick']."님이 추천", $bo_table, $wr_id, $member['mb_id'].'추천'); 

insert_point($member['mb_id'], 100, "추천 했습니다.", $bo_table, $wr_id, $member['mb_id'].'추천하기'); 
} 
else 
{ 
$status = "비추천"; 
insert_point($write[mb_id], -200, "비추천 점수를 받았습니다.", $bo_table, $wr_id, $member['mb_id'].'비추'); 
} 
            print_result($error, $count);
        }
    }      
}

good.php 파일 171번째정도줄에

저렇게 바꾸었는데 추천5번을 넘게해도 제한이 안걸립니다.

어디가 문제일까요.

|

답변 1개 / 댓글 1개

if ($tm1['cnt'] >= 5) 
        alert("추천은 하루에 5번만 가능합니다.");

이부분을

if ($tm1['cnt'] >= 5) {
    $error = '추천은 하루에 5번만 가능합니다.';
    print_result($error, $count);
}

이렇게 바꾸셔야합니다. 비동기 통신이라 alert이 안먹힐겁니다.

답변에 대한 댓글 1개

감사합니다.
그런데 추천을 100개를 해도 계속 추천이 진행이 됩니다. ㅠ
어디에서 문제일까요 ㅠ

답변을 작성하려면 로그인이 필요합니다.