<% StatLog Dim Counterfile, fs, a, CurrentCount, b, strurl,newurl newurl = Request.Querystring("url") If Instr(1,newurl,"?AGENT",1) Then completeurl = newurl & "&DESC=" & Request.Querystring("DESC") & "&DESC1=" & Request.Querystring("DESC1") & "&GP=" & Request.Querystring("GP") Response.Redirect(completeurl) Else strurl = Replace(Mid(Request.Querystring("url"),8,Len(Request.Querystring("url"))),".","") tempname = Len(strurl) - 3 strurl = Left(strurl,tempname) strurl = Replace(strurl,"/","-") strurl = Replace(strurl,"\","-") CounterFile = Server.MapPath ("/ctrfiles/ads/clicks/") & "\" & strurl & ".txt" Set fs = CreateObject("Scripting.FileSystemObject") CurrentCount = Date() & "|" & Time() & "|" & lcase(Request.ServerVariables("HTTP_REFERER")) If fs.FileExists(Server.MapPath ("/ctrfiles/ads/clicks/") & "\" & strurl & ".txt") then Set a = fs.OpenTextFile(CounterFile, 8, 0, 0) a.writeLine CurrentCount a.Close else set b = fs.CreateTextFile (CounterFile, 1, 0) b.WriteLine CurrentCount b.Close end if Set fs = Nothing Response.Redirect(newurl) End if %>