Solved

HTML Counter

Posted on 1998-10-12
3
224 Views
Last Modified: 2010-04-09
I want to know what the code for constructing a page counter is.  I think it might be either in vbscript or asp(and maybe not).  It is for a course project and I have to write the code myself from scratch.  Thank you.
0
Comment
Question by:kristinca
3 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1838646
So in order not to deprive you of the learning process, I will give you some hints:

1. The counter program must be server based since you need somewhere to store a file with the number that gets incremented.
2. The program reads this file (creates it and sets the value to 0 if the file does not exist), increments the value and writes the value back to the file and
3 returns some text (SSI or ASP) or an image (gif) or a redirect to an image representing the value of the counter.

Michel
0
 

Expert Comment

by:tunct
ID: 1838647
Have a look at www.TheCounter.com. This one offers lots of statistics & requires you to put some javascript into your page... might not be exactly what you want :)

The old way is to have an image tag with "src" parameter being a cgi-binary (there are also plain text counters). This means contacting your sysadmin and asking questions. You might try to link some off-site counters as well... just examine the html code of pages  which have counters.

Best Regards,
T.
0
 
LVL 10

Accepted Solution

by:
MasseyM earned 100 total points
ID: 1838648
I will give you the code, Here it is in ASP:

<%   ' Lock the Application object  
     Application.Lock  
     ' Increment the count
     Application("Count") = Application("Count") + 1
     ' Unlock the Application object
     Application.Unlock
%>

This is from the Microsoft MIND magazine...
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question