weblog

M

Matt

Does ASP provide weblog functionality? For example, I want to collect the
statistics of every page in the home page, how people access the pages,
etc...

In C:\WINNT\system32\LogFiles\W3SVC1, it has collections of web log file. I
guess we can parse the file and do the analysis??
 
S

Steven Burn

Or you could place something along the lines of the following in the header
file of your page(s)

<%
'Just do the following for whatever you want to log (referer, page
accessed etc)
' then write it out to a text file

dim referer
referer = Request.ServerVariables("HTTP_REFERER")

'Your "write to log" code goes here........
%>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 
M

Matt

What is "HTTP_REFERER", if i do the following, it won't print anything

Response.Write(referer)
 
S

Steven Burn

HTTP_REFERER is the refering page (the site/page your visitor came from)

The following is some sample code you can use to test it. Note however, if
you go directly to the page, it will not show a referer (basically because
there wouldn't be one).

<%
Dim HTTPReferer
HTTPReferer = Request.ServerVariables("HTTP_REFERER")

Response.Write HTTPReferer

Select Case HTTPReferer
Case "http://www.google.co.uk"
Response.Write "You came from http://www.google.co.uk"
Case "http://www.google.com"
Response.Write "You came from http://www.google.com"
Case "http://www.yahoo.co.uk"
Response.Write "You came from http://www.yahoo.co.uk"
Case Else
Response.Write "You came from " & HTTPReferer
End Select
%>
--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top