asp
쿠키를 이용해서 중복 추천 방지하기
duraboys
2007. 5. 2. 23:54
Sub VoteComment
req_comment_idx = Request("comment_idx")
x.Init "TT_COMMENT",""
if request.cookies("vote")(req_comment_idx) = "ok" then
szMsg = "msgː♪이미 추천하셨습니다♪ː"
else
szField = "vote"
szValue = "vote + 1"
szWhere = "comment_idx="&req_comment_idx
if x.UpWhere(szField, szValue, szWhere) = false then
szMsg = "msgː♪코멘트 삭제 실패♪ː"
else
szMsg = "msgː♪추천 하였습니다.♪ː"
end if
Response.Cookies("vote").expires = #12/31/2010 00:00:00#
Response.Cookies("vote")(req_comment_idx) = "ok"
end if
Response.Write szMsg
REsponse.End
End Sub
req_comment_idx = Request("comment_idx")
x.Init "TT_COMMENT",""
if request.cookies("vote")(req_comment_idx) = "ok" then
szMsg = "msgː♪이미 추천하셨습니다♪ː"
else
szField = "vote"
szValue = "vote + 1"
szWhere = "comment_idx="&req_comment_idx
if x.UpWhere(szField, szValue, szWhere) = false then
szMsg = "msgː♪코멘트 삭제 실패♪ː"
else
szMsg = "msgː♪추천 하였습니다.♪ː"
end if
Response.Cookies("vote").expires = #12/31/2010 00:00:00#
Response.Cookies("vote")(req_comment_idx) = "ok"
end if
Response.Write szMsg
REsponse.End
End Sub