Solved

HTML Counter

Posted on 1998-10-12
3
199 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now