first commit
This commit is contained in:
104
Lib/visit_click_log.asp
Normal file
104
Lib/visit_click_log.asp
Normal file
@@ -0,0 +1,104 @@
|
||||
<!-- #include Virtual="./Lib/Config.asp" -->
|
||||
<%
|
||||
'모바일인지 pc인지 체크하기
|
||||
Dim mobileYN, mob_id, mob, splitmo, agent, sUserAgent, iNo, osVal, l_host, l_referer, l_ip_reg, l_now_page
|
||||
Dim data_pkey, data_idkey
|
||||
Dim etc_1, etc_2, etc_3 , etc_4
|
||||
dim PRJCODE, IDKEY
|
||||
|
||||
On Error Resume Next
|
||||
|
||||
Dim CID : CID = Request("CID")
|
||||
Dim ISCAPI : ISCAPI = "999"
|
||||
PRJCODE = request("PRJCODE")
|
||||
data_idkey = request("IDKEY")
|
||||
etc_1 = request("etc_1")
|
||||
etc_2 = request("etc_2")
|
||||
etc_3 = request("etc_3")
|
||||
etc_4 = request("etc_4")
|
||||
|
||||
if CID = "wi11u215oh" then
|
||||
ISCAPI = "ALL"
|
||||
elseif CID = "83ex9w1qe2" then
|
||||
ISCAPI = "0"
|
||||
elseif CID = "85089yodxm" then
|
||||
ISCAPI = "1"
|
||||
elseif CID = "9xno5431w7" then
|
||||
ISCAPI = "2"
|
||||
elseif CID = "d66u9c5w0" then
|
||||
ISCAPI = "3"
|
||||
elseif CID = "E40caw63qg4" then
|
||||
ISCAPI = "4"
|
||||
elseif CID = "h6yubq8a2me" then
|
||||
ISCAPI = "5"
|
||||
end if
|
||||
|
||||
|
||||
if iscapi = "999" then
|
||||
'response.write "유효하지 않은 링크입니다. 관리자에게 문의하세요."
|
||||
response.write "{""result"":""9999"", ""msg"":""유효하지 않은 링크입니다. 관리자에게 문의하세요.""}"
|
||||
response.end
|
||||
end if
|
||||
|
||||
|
||||
data_pkey = PRJCODE
|
||||
|
||||
mobileYN = "pc"
|
||||
mob_id = ""
|
||||
|
||||
|
||||
'mob = "iPad|iPod|iPhone|Android|BlackBerry|SymbianOS|SCH-M\d+|Opera Mini|Windows CE|Nokia|SonyEricsson|webOS|PalmOS"
|
||||
mob = "iPad|iPhone|iPod|Android|Windows CE|BlackBerry|SymbianOS|Symbian|SCH-M\d+|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson|PalmOS|LG|SAMSUNG|Samsung"
|
||||
splitmo = split(mob,"|")
|
||||
agent = Request.ServerVariables("HTTP_USER_AGENT")
|
||||
For iNo = 0 to UBound(splitmo )
|
||||
If InStr(agent,splitmo (iNo)) > 0 Then
|
||||
mobileYN = "mobile"
|
||||
mob_id = splitmo (iNo)
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
sUserAgent = UCase(Request.ServerVariables("HTTP_USER_AGENT"))
|
||||
if Instr(sUserAgent,"ANDROID") > 0 then
|
||||
osVal = "ANDROID"
|
||||
elseif Instr(sUserAgent,"IPAD") > 0 or Instr(sUserAgent,"IPHONE") > 0 then
|
||||
osVal = "IOS"
|
||||
else
|
||||
osVal = "ETC"
|
||||
end if
|
||||
|
||||
l_host = Request.ServerVariables("HTTP_HOST") //호스트 정보 추출
|
||||
l_referer = Request.ServerVariables("HTTP_REFERER") //이전 페이지 정보(url 입력으로 접근은 값 없음)
|
||||
l_ip_reg = Request.ServerVariables("REMOTE_ADDR") // IP 주소 추출
|
||||
l_now_page = request.servervariables("HTTP_HOST") & request.servervariables("HTTP_url")
|
||||
|
||||
|
||||
Dim strSQL_log
|
||||
|
||||
'//-- strSQL_log = "INSERT INTO kon.dbo.visit_log (user_agent, osVal, mob_id, mobileYN, host, referer, logdate, ip, etc_1, DATA_IDKEY, DATA_PKEY, now_page) VALUES( "
|
||||
strSQL_log = "INSERT INTO Kon.dbo.visit_click_log(DATA_IDKEY, DATA_PKEY, mobileYN, host, now_page, logdate, ip, etc_1, etc_2, etc_3) VALUES( "
|
||||
strSQL_log = strSQL_log & "'" & data_idkey & "', "
|
||||
strSQL_log = strSQL_log & "'" & data_pkey & "', "
|
||||
strSQL_log = strSQL_log & "'" & mobileYN & "', "
|
||||
strSQL_log = strSQL_log & "'" & l_host & "', "
|
||||
strSQL_log = strSQL_log & "'" & l_now_page & "', "
|
||||
strSQL_log = strSQL_log & " getdate(), "
|
||||
strSQL_log = strSQL_log & "'" & l_ip_reg & "', "
|
||||
strSQL_log = strSQL_log & "'" & etc_1 & "', "
|
||||
strSQL_log = strSQL_log & "'" & etc_2 & "', "
|
||||
strSQL_log = strSQL_log & "'" & etc_3 & "' "
|
||||
|
||||
strSQL_log = strSQL_log & " )"
|
||||
|
||||
'response.write data_idkey &"-------------"
|
||||
'response.write strSQL_log
|
||||
response.write "{""result"":""0000"", ""msg"":""Success""}"
|
||||
|
||||
|
||||
Call DBConnect2()
|
||||
|
||||
DBConn.Execute strSQL_log
|
||||
|
||||
call DBClose()
|
||||
%>
|
||||
Reference in New Issue
Block a user