Code:
<%
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim objFSO, objFileName, objOpenFile, RemoteAddress, ReferringSite
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFileName = objFSO.GetFile(Server.MapPath("/log.txt"))
Set objOpenFile = objFileName.OpenAsTextStream(ForAppending)
'
RemoteAddress = Request.ServerVariables("REMOTE_ADDR")
ReferringSite = Request.ServerVariables("HTTP_REFERER")
objOpenFile.WriteLine "IP:: " & RemoteAddress & "; ReferredBy:: " & ReferringSite & ";"
'
objOpenFile.Close
Set objOpenFile = Nothing
Set objFileName = Nothing
Set objFSO = Nothing
%>
Bookmarks