Function to log the redirects that happen into website
It is merely used with ANmaRedirect to log in the time and the domain that the user is coming from, to see how many people are actually using those domains.
This function to be placed in the destination page, to log in the time and the domain coming from.
It uses the QueryString ComingFrom that is passed with ANmaRedirect
<%
ANmaRedirectURL = Request.QueryString("ComingFrom")
' Are we being redirected from another domain?
If ANmaRedirectURL > "" Then ANmaRedirect_Plus1 ANmaRedirectURL
Function ANmaRedirect_Plus1(ComingFromDomain)
' Adds 1 to the counter in file
' Creates (or adds line) to the file ANmaRedirect.txt in root
' HAving 1 line per domain
'
ANmaFile = "/Assets/ANmaRedirect.txt"
FileBlock = "' ANmaRedirect file" & vbcrlf & "' Created at " & Now() & vbcrlf
FileBlock = FileBlock & "' ------------- by: ANmar.Systems ---" & vbcrlf
FileBlock = FileBlock & "' ------------------------------------------" & vbcrlf
If IsThere(ANmaFile) Then FileBlock = ASCII_Read(ANmaFile, 1)
FileBlock = FileBlock & Now() & " | " & ComingFromDomain & "" & vbcrlf
ASCII_Save ANmaFile, FileBlock, 1
End Function
% >
ANmaRedirectURL = Request.QueryString("ComingFrom")
' Are we being redirected from another domain?
If ANmaRedirectURL > "" Then ANmaRedirect_Plus1 ANmaRedirectURL
Function ANmaRedirect_Plus1(ComingFromDomain)
' Adds 1 to the counter in file
' Creates (or adds line) to the file ANmaRedirect.txt in root
' HAving 1 line per domain
'
ANmaFile = "/Assets/ANmaRedirect.txt"
FileBlock = "' ANmaRedirect file" & vbcrlf & "' Created at " & Now() & vbcrlf
FileBlock = FileBlock & "' ------------- by: ANmar.Systems ---" & vbcrlf
FileBlock = FileBlock & "' ------------------------------------------" & vbcrlf
If IsThere(ANmaFile) Then FileBlock = ASCII_Read(ANmaFile, 1)
FileBlock = FileBlock & Now() & " | " & ComingFromDomain & "" & vbcrlf
ASCII_Save ANmaFile, FileBlock, 1
End Function
% >
ComingFromDomain
Views 1,651
Downloads 476
CodeID
DB ID