Counter

J

Jim in Arizona

I've been looking for a counting script to count the number of hits to my
HTM and asp web pages on my company's internal website. So far, everything
I've seen only works on asp pages. Where would I find some counter code to
record hits on htm(l) as well as asp pages?

I'm using IIS 5.0.

Thanks.
 
E

Evertjan.

Jim in Arizona wrote on 15 okt 2004 in
microsoft.public.inetserver.asp.general:
I've been looking for a counting script to count the number of hits to
my HTM and asp web pages on my company's internal website. So far,
everything I've seen only works on asp pages. Where would I find some
counter code to record hits on htm(l) as well as asp pages?

I'm using IIS 5.0.


This NG is an ASP forum, so I will try an asp answer.

In IIS you can set .htm and .html extension files to act like .asp files
and be processed by the asp engine.

btw, why don't you simply change the extension of your .htm file to .asp ?
 
J

Jim in Arizona

Evertjan. said:
Jim in Arizona wrote on 15 okt 2004 in
microsoft.public.inetserver.asp.general:



This NG is an ASP forum, so I will try an asp answer.

In IIS you can set .htm and .html extension files to act like .asp files
and be processed by the asp engine.

btw, why don't you simply change the extension of your .htm file to .asp ?


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

I will probably change all the extensions, eventually, but the site is too
large to take the time to do that right now. I've got over 5000 htm files on
the site and they're all linked to other htm files. It's going to requre
some considerable resources to make the change.

Thanks for the info.
 
D

Dave Anderson

Jim said:
I will probably change all the extensions, eventually, but the site
is too large to take the time to do that right now. I've got over
5000 htm files on the site and they're all linked to other htm files.
It's going to requre some considerable resources to make the change.

But clearly you will need to touch all of them to add your counter, right?
Assuming you parse htm/html docs with asp.dll, you could condense the
solution to a single #include insertion.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
J

Joker

Another thing that could make this easier is FrontPage. When you rename
a file using FrontPage & the FrontPage server extensions (I'm not sure
how it works in 2003 since they dumped the server extensions) all HTML
links point to the new file name. Of course that is just a thought.
I will probably change all the extensions, eventually, but the site is too
large to take the time to do that right now. I've got over 5000 htm files on
the site and they're all linked to other htm files. It's going to requre
some considerable resources to make the change.

Thanks for the info.

--
Please do not contact me directly or ask me to contact you directly for
assistance.

If your question is worth asking, it's worth posting.

If it’s not worth posting you should have done a search on
http://www.google.com/ http://www.google.com/grphp?hl=en&tab=wg&q= or
http://news.google.com/froogle?hl=en&tab=nf&ned=us&q= before wasting our
time.
 
B

Bill

Include this in the body of all your HTML pages where you want the counter
to appear:

<SCRIPT SRC="counter.asp" LANGUAGE="javascript"></SCRIPT>

When processed, counter.asp *must* return a javascript formatted file to the
calling HTML page. You can do your counter housework in ASP, and then use
javascript to write the output.


---- COUNTER.ASP
<%
Response.Expires = 0
' do counter stuff here, and store it in strPageCount
%>
// this is the javascript
document.write('<%=strPageCount%> visits to this page');
end ----------------------


-Bill.
 
L

Larry Bud

I will probably change all the extensions, eventually, but the site is too
large to take the time to do that right now. I've got over 5000 htm files on
the site and they're all linked to other htm files. It's going to requre
some considerable resources to make the change.

Just use a text editor with "search/replace in files" capability, such
as UltraEdit, to do a find for .htm and replace with .asp
 

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,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top