아는 것이 좋은 것이다.

[ASP] 중복 조회수 처리 본문

ASP

[ASP] 중복 조회수 처리

start0 2014. 4. 24. 22:24

 
함수 적용

' ***************************************************************************************
' 쿠키 중복 체크
' ***************************************************************************************
Function CookieDuplicateCheck(tableName, idx)
     dim dupliChk
     dim c_read_idx
     dim i
     dupliChk = false
   
     c_read_idx = Request.Cookies("C_TABLE_NAME")("READ")
   
     Response.Cookies("C_TABLE_NAME") = tableName
     Response.Cookies("C_TABLE_NAME").Path = "/"
     Response.Cookies("C_TABLE_NAME").Expires = date+1

    arrRead = split(c_read_idx,",")
     for i = 1 to UBound(arrRead)
         if CInt(idx) = CInt(Trim(arrRead(i))) then
             dupliChk = true
         end if
     next
     if dupliChk = true then
         Response.Cookies("C_TABLE_NAME")("READ") = c_read_idx
     else
         Response.Cookies("C_TABLE_NAME")("READ") = c_read_idx & "," & idx
     end if
     CookieDuplicateCheck = dupliChk
End Function

실제 소스 코드

<%
dupliChk = CookieDuplicateCheck("GA_BOARD",bseq)
  IF dupliChk = false THEN


strSql="update BOARDNAME set iread=iread+1 where bseq=" & bseq

Dbcon.Execute strSql

END IF
%>

Comments