Solved

HTML Counter

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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.…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

813 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

10 Experts available now in Live!

Get 1:1 Help Now