Zanima me kako bih mogao skupiti podatke o posjetiteljima pomocu global.asa fajla.
Od podataka o posjetitelju bi mi trebali: OS, Browser, Rezolucija, IP, vrijeme dolaska, vrijeme odlaska, ...
Na netu sam nasao neke upute kako napraviti takav fjl, al izgleda da nisam dobro shvatio nacin kako ga napraviti, jer uporno negdje grijesim, molio bih vas da mi pomognete.
Unaprijed zahvaljujem
Možda nemaš ovaj objekt:
Set BC = server.createobject("MSWC.BrowserType")
Možda će ti ovo pomoći:
strIPAddress = Request.ServerVariables("REMOTE_ADDR")
strUserAgent = Request.ServerVariables("HTTP_USER_AGENT")
If InStr(1, strUserAgent, "Opera 3", 1) Then
strBrowserUserType = "Opera 3"
ElseIf InStr(1, strUserAgent, "Opera 4", 1) Then
strBrowserUserType = "Opera 4"
ElseIf InStr(1, strUserAgent, "Opera 5", 1) Then
strBrowserUserType = "Opera 5"
ElseIf InStr(1, strUserAgent, "Opera 6", 1) Then
strBrowserUserType = "Opera 6"
ElseIf InStr(1, strUserAgent, "Opera", 1) Then
strBrowserUserType = "Opera"
ElseIf inStr(1, strUserAgent, "MSIE 6", 1) Then
strBrowserUserType = "Microsoft IE 6"
ElseIf inStr(1, strUserAgent, "MSIE 5", 1) Then
strBrowserUserType = "Microsoft IE 5"
ElseIf inStr(1, strUserAgent, "MSIE 4", 1) Then
strBrowserUserType = "Microsoft IE 4"
ElseIf inStr(1, strUserAgent, "MSIE 3", 1) Then
strBrowserUserType = "Microsoft IE 3"
ElseIf inStr(1, strUserAgent, "Mozilla/5", 1) OR inStr(1, strUserAgent, "Netscape6", 1) Then
strBrowserUserType = "Netscape 6"
ElseIf inStr(1, strUserAgent, "Mozilla/4", 1) Then
strBrowserUserType = "Netscape 4"
ElseIf inStr(1, strUserAgent, "Mozilla/3", 1) Then
strBrowserUserType = "Netscape 3"
Else
strBrowserUserType = "Unknown"
End If
If inStr(1, strUserAgent, "NT 5.1", 1) Or inStr(1, strUserAgent, "Windows XP", 1) Then
strOS = "Windows XP"
ElseIf inStr(1, strUserAgent, "NT 5", 1) Or inStr(1, strUserAgent, "Windows 2000", 1) Then
strOS = "Windows 2000"
ElseIf inStr(1, strUserAgent, "NT", 1) Or inStr(1, strUserAgent, "WinNT", 1) Then
strOS = "Windows NT 4"
ElseIf inStr(1, strUserAgent, "95", 1) Or inStr(1, strUserAgent, "Win95", 1) Then
strOS = "Windows 95"
ElseIf inStr(1, strUserAgent, "Win 9x 4.90", 1) Then
strOS = "Windows ME"
ElseIf inStr(1, strUserAgent, "98", 1) Or inStr(1, strUserAgent, "Win98", 1) Then
strOS = "Windows 98"
ElseIf Instr(1, strUserAgent, "Windows 3.1", 1) or Instr(1, strUserAgent, "Win16", 1) Then
strOS = "Windows 3.x"
ElseIf inStr(1, strUserAgent, "Macintosh", 1) OR inStr(1, strUserAgent, "Mac", 1) OR inStr(1, strUserAgent, "Macintosh;", 1) Then
strOS = "Macintosh"
ElseIf inStr(1, strUserAgent, "Linux", 1) Then
strOS = "Linux"
ElseIf inStr(1, strUserAgent, "Unix", 1) OR inStr(1, strUserAgent, "sunos", 1) OR inStr(1, strUserAgent, "X11", 1) Then
strOS = "Unix"
ElseIf inStr(1, strUserAgent, "WebTV", 1) OR inStr(1, strUserAgent, "AOL_TV", 1) Then
strOS = "Web TV"
Else
strOS = "Unknown"
End If
Za datum dolaska i odlaska se pobrini sam.
Za rezoluciju ne znam, ja mislim da je to nemogće saznati sa server-side skriptom.
Na lokalnom serveru mi pokazuje da se greska nalazi u ovom redu, ali, ja nemogu skuziti sto sam krivo napisao.
Conn.execute "insert into tblPosjetioci (Dolazak," & "Referer, Browser, OS) values (" & "'" & Now & "'," & "'" & Referer & "'," & "'" & Browser & "'," & "'" & Platform & "')"
Na lokalnom serveru mi pokazuje da se greska nalazi u ovom redu, ali, ja nemogu skuziti sto sam krivo napisao.
Probaj ovako:
strSQL = "INSERT INTO tblPosjetioci (Dolazak, Referer, Browser, OS) " & _
"VALUES (Now(),'" & Referer & "','" & "','" & Browser & "','" & "','" & Platform & "');"
conn.Execute(strSQL)
P.S. Polje 'dolazak' mora biti tipa Date/Time.
Ali ne uspjeva, dobivam ovu poruku:
Error Type:
Microsoft JET Database Engine (0x80040E14)
Number of query values and destination fields are not the same.
Sorry,moja greška...
Ovako probaj:
strSQL = "INSERT INTO tblPosjetioci (Dolazak, Referer, Browser, OS) " & _
"VALUES (Now(),'" & Referer & "','" & Browser & "','" & Platform & "');"
conn.Execute(strSQL)
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.