I have an app. that saves some info(Date, Time, Browser Type and IP address) to a text file everytime a banner is clicked.
My problem is that the Date and Time keep going back and forth between US and UK formats.
Any thoughts?
Here's the page that handles the clicks:
<%
CountClick = Request("Id"
RedirectTo = Request("Url"
ClicksNow = Request("CCT"
CID = Request("5779"
NewClicksNow = ClicksNow + 1
If CountClick = "" OR RedirectTo = "" OR ClicksNow = "" OR CID = "" Then
Response.Redirect("404Error.asp"
Else
Set MyConn=Server.CreateObject("ADODB.Connection"
MyConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\..\xxx.mdb"
Set RS=Server.CreateObject("ADODB.RecordSet"
SQL = vbNullString
SQL = SQL & "UPDATE Clients "
SQL = SQL & "SET ClicksNow="&NewClicksNow&" WHERE ID="&CountClick&""
MyConn.execute(SQL)
MyConn.Close
Set MyConn = Nothing
strT = Time()
strT = replace(strT,",",""
strT = replace(strT,Chr(10),"",1,-1,0)
strT = replace(strT,Chr(13),"",1,-1,0)
strD = Date()
strD = replace(strD,",",""
strD = replace(strD,Chr(10),"",1,-1,0)
strD = replace(strD,Chr(13),"",1,-1,0)
strRA = Request.ServerVariables("REMOTE_ADDR"
strRA = replace(strRA,",",""
strRA = replace(strRA,Chr(10),"",1,-1,0)
strRA = replace(strRA,Chr(13),"",1,-1,0)
strUA = Request.ServerVariables("HTTP_USER_AGENT"
strUA = replace(strUA,",",""
strUA = replace(strUA,Chr(10),"",1,-1,0)
strUA = replace(strUA,Chr(13),"",1,-1,0)
fname = server.mappath(CID + ".txt"
Set objFSO = CreateObject("Scripting.FileSystemObject"
Set objText = objFSO.OpenTextFile(fname, 8, true)
objText.Write(strT + "," + strD + "," + strRA + "," + strUA) & VBcrlf
objText.Close
Response.Redirect (RedirectTo)
End If
%>
Thank you,
Lucas
My problem is that the Date and Time keep going back and forth between US and UK formats.
Any thoughts?
Here's the page that handles the clicks:
<%
CountClick = Request("Id"
RedirectTo = Request("Url"
ClicksNow = Request("CCT"
CID = Request("5779"
NewClicksNow = ClicksNow + 1
If CountClick = "" OR RedirectTo = "" OR ClicksNow = "" OR CID = "" Then
Response.Redirect("404Error.asp"
Else
Set MyConn=Server.CreateObject("ADODB.Connection"
MyConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\..\xxx.mdb"
Set RS=Server.CreateObject("ADODB.RecordSet"
SQL = vbNullString
SQL = SQL & "UPDATE Clients "
SQL = SQL & "SET ClicksNow="&NewClicksNow&" WHERE ID="&CountClick&""
MyConn.execute(SQL)
MyConn.Close
Set MyConn = Nothing
strT = Time()
strT = replace(strT,",",""
strT = replace(strT,Chr(10),"",1,-1,0)
strT = replace(strT,Chr(13),"",1,-1,0)
strD = Date()
strD = replace(strD,",",""
strD = replace(strD,Chr(10),"",1,-1,0)
strD = replace(strD,Chr(13),"",1,-1,0)
strRA = Request.ServerVariables("REMOTE_ADDR"
strRA = replace(strRA,",",""
strRA = replace(strRA,Chr(10),"",1,-1,0)
strRA = replace(strRA,Chr(13),"",1,-1,0)
strUA = Request.ServerVariables("HTTP_USER_AGENT"
strUA = replace(strUA,",",""
strUA = replace(strUA,Chr(10),"",1,-1,0)
strUA = replace(strUA,Chr(13),"",1,-1,0)
fname = server.mappath(CID + ".txt"
Set objFSO = CreateObject("Scripting.FileSystemObject"
Set objText = objFSO.OpenTextFile(fname, 8, true)
objText.Write(strT + "," + strD + "," + strRA + "," + strUA) & VBcrlf
objText.Close
Response.Redirect (RedirectTo)
End If
%>
Thank you,
Lucas