URL 파싱 함수이며, 유입경로중에 도메인만 걸러내는 함수이다.

function URL_Parser(strURL)
   dim ObjRegExp
   on error resume next
   set ObjRegExp = New RegExp
   With ObjRegExp
      .Global = true
      .IgnoreCase = true
      .Pattern = "http://(([a-zA-Z][-a-zA-Z0-9]*([.][a-zA-Z][-a-zA-Z0-9]*){0,3})||([0-9]{1,3}([.][0-9]{1,3}){3}))"
      workURL = .Replace(strURL, "")
   end With
 
   set ObjRegExp = nothing
   URL_Parser = Replace(strURL, "http://", "", 1, -1, 1)

end function

HTTP_REFERER 를 이용해서 이전 URL 정보를 받는다.
얻어진 정보가 없다는것은 브라우저에서 직접 입력했거나 빈페이지에서 즐겨찾기등이라는것을 의미한다.
set_URL 값을 이용 통계 테이블에 해당 도메인이 존재하면 카운터 증가 / 없으면 추가 등으로 작업한다.

get_URL = Request.ServerVariables("HTTP_REFERER")

if get_URL = "" or isnull(get_URL) then
   set_URL = "Direct Connect"
else
   set_URL = URL_Parser(get_URL)
end If
2009/05/27 17:36 2009/05/27 17:36

Trackback Address :: https://youngsam.net/trackback/517