Link to home
Start Free TrialLog in
Avatar of kristinca
kristinca

asked on

HTML Counter

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.
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

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
Avatar of tunct
tunct

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.
ASKER CERTIFIED SOLUTION
Avatar of MasseyM
MasseyM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial