first commit
This commit is contained in:
88
Lib/visit_log.asp
Normal file
88
Lib/visit_log.asp
Normal file
@@ -0,0 +1,88 @@
|
||||
|
||||
<%
|
||||
'모바일인지 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, data_surveytype, data_pagename, data_qnumber
|
||||
|
||||
|
||||
On Error Resume Next
|
||||
|
||||
data_pkey = PRJCODE
|
||||
data_idkey = IDKEY
|
||||
data_surveytype = SURVEYTYPE
|
||||
data_pagename = PAGENAME
|
||||
data_qnumber = QNUMBER
|
||||
|
||||
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")
|
||||
|
||||
%>
|
||||
<!--
|
||||
<%'=sUserAgent %> -----
|
||||
<%'=osVal %> -----
|
||||
<%'=mob_id %> -----
|
||||
<%'=mobileYN %> -----
|
||||
<%'=agent %>
|
||||
<%'=l_host %>
|
||||
<%'=l_referer %>
|
||||
<%'=l_ip_reg %>
|
||||
<%'=l_now_page %>
|
||||
-->
|
||||
<%
|
||||
|
||||
Dim strSQL_log
|
||||
|
||||
strSQL_log = "INSERT INTO kon.dbo.visit_log (user_agent, osVal, mob_id, mobileYN, host, referer, logdate, ip, etc_1, etc_2, DATA_IDKEY, DATA_PKEY, now_page) VALUES( "
|
||||
strSQL_log = strSQL_log & "'" & agent & "', "
|
||||
strSQL_log = strSQL_log & "'" & osVal & "', "
|
||||
strSQL_log = strSQL_log & "'" & mob_id & "', "
|
||||
strSQL_log = strSQL_log & "'" & mobileYN & "', "
|
||||
strSQL_log = strSQL_log & "'" & l_host & "', "
|
||||
strSQL_log = strSQL_log & "'" & l_referer & "', "
|
||||
strSQL_log = strSQL_log & " getdate(), "
|
||||
strSQL_log = strSQL_log & "'" & l_ip_reg & "', "
|
||||
|
||||
strSQL_log = strSQL_log & "'" & data_surveytype & "', "
|
||||
strSQL_log = strSQL_log & "'" & data_pagename & "', "
|
||||
strSQL_log = strSQL_log & "'" & data_idkey & "', "
|
||||
strSQL_log = strSQL_log & "'" & data_pkey & "', "
|
||||
|
||||
strSQL_log = strSQL_log & "'" & l_now_page & "'"
|
||||
strSQL_log = strSQL_log & " )"
|
||||
|
||||
'response.write strSQL_log
|
||||
|
||||
|
||||
Call DBConnect2()
|
||||
|
||||
DBConn.Execute strSQL_log
|
||||
|
||||
call DBClose()
|
||||
%>
|
||||
Reference in New Issue
Block a user