|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Is there anyone here that could help me install this site statistics ASP script on my website?
Here's the script: http://authors.aspalliance.com/stevesmith/samples/sitestats.asp Please Help, Thanks! |
|
#2
|
||||
|
||||
|
is there something specific you need help with?
it seems pretty strait forward?
__________________
Look! Its a ShemZilla ![]() ![]()
|
|
#3
|
|||
|
|||
|
Quote:
I don't know what to do with the script to install it to my site. ![]() |
|
#4
|
||||
|
||||
|
ok,
you need to create a table in your database: tablename: user_log columns: user_id, log_date, action_code, browser, ip_address then you add this code to your global.asa in session_onstart Code:
'Update user database
set conntemp=server.createobject("adodb.connection")
cnpath="DBQ=" & server.mappath("/stevesmith/data/timesheet.mdb")
conntemp.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & cnpath
sqlString = "INSERT INTO user_log " & _
" (user_id,log_date,action_code,browser,ip_address) " & _
" VALUES ('Unknown',now,'L','" & _
Request.ServerVariables("HTTP_USER_AGENT") & "','" & _
Request.ServerVariables("REMOTE_HOST") & "')"
Set logRS=conntemp.execute(sqlString)
Set logRS=nothing
Include on any page whose hits you wish to track: Code:
'Update pagelog
Dim hdrconntemp
Dim hdrcnpath
Dim hdrsqlString
Dim hdrlogRS
set hdrconntemp=server.createobject("adodb.connection")
hdrcnpath="DBQ=" & server.mappath("/stevesmith/data/timesheet.mdb")
hdrconntemp.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & hdrcnpath
hdrsqlString = "INSERT INTO page_log " & _
" (page,log_date,action_code,browser,ip_address) " & _
" VALUES ('" & Request.ServerVariables("SCRIPT_NAME") & "',now,'L','" & _
Request.ServerVariables("HTTP_USER_AGENT") & "','" & _
Request.ServerVariables("REMOTE_HOST") & "')"
Set hdrlogRS= hdrconntemp.execute(hdrsqlString)
Set hdrlogRS=nothing
and then you just call the usage.asp page if you want to view the stats. just make sure to change the datasource to your database. |
|
#5
|
|||
|
|||
|
Quote:
Thank you very much! ![]() |
|
#6
|
||||
|
||||
|
no worries
![]() |
|
#7
|
|||
|
|||
|
I'm having a few problems
- Where can I find my global.asa ? - I created the table w/ the 6 needed columns, am I doing it correctly? -Please See Screenshot- ![]() - What do I need to edit here? Code:
'Update user database
set conntemp=server.createobject("adodb.connection")
cnpath="DBQ=" & server.mappath("/stevesmith/data/timesheet.mdb")
conntemp.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & cnpath
sqlString = "INSERT INTO user_log " & _
" (user_id,log_date,action_code,browser,ip_address) " & _
" VALUES ('Unknown',now,'L','" & _
Request.ServerVariables("HTTP_USER_AGENT") & "','" & _
Request.ServerVariables("REMOTE_HOST") & "')"
Set logRS=conntemp.execute(sqlString)
Set logRS=nothing
& Code:
'Update pagelog
Dim hdrconntemp
Dim hdrcnpath
Dim hdrsqlString
Dim hdrlogRS
set hdrconntemp=server.createobject("adodb.connection")
hdrcnpath="DBQ=" & server.mappath("/stevesmith/data/timesheet.mdb")
hdrconntemp.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & hdrcnpath
hdrsqlString = "INSERT INTO page_log " & _
" (page,log_date,action_code,browser,ip_address) " & _
" VALUES ('" & Request.ServerVariables("SCRIPT_NAME") & "',now,'L','" & _
Request.ServerVariables("HTTP_USER_AGENT") & "','" & _
Request.ServerVariables("REMOTE_HOST") & "')"
Set hdrlogRS= hdrconntemp.execute(hdrsqlString)
Set hdrlogRS=nothing
IE: /stevesmith/data/timesheet.mdb - what is a .mdb & what shall I need to change it to? Any help would be very much appreciated, Thanks! ![]() |
|
#8
|
||||
|
||||
|
you are using a mySQL DB, so you will need to change the mdb (MS Access)
to mySQL, you can find a list of connections here: http://www.connectionstrings.com so instead of Code:
hdrcnpath="DBQ=" & server.mappath("/stevesmith/data/timesheet.mdb")
hdrconntemp.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & hdrcnpath
you'll have Code:
hdrconntemp.Open "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=myDatabase;USER= myUsername;PASSWORD=myPassword;OPTION=3;"
hope this helps |
|
#9
|
|||
|
|||
|
Thanks a lot for all your help nofriends! but I can't find my global.asa file on my root dir? I've checked all my folders but I can't find it anywhere!? Do I need to make the global.asa file myself?
![]() |
|
#10
|
||||
|
||||
|
|
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > I need this (ASP Application: Site Statistics) Installed on my website please help! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|