Important alert: (current site time 7/15/2013 11:08:40 PM EDT)
 

winzip icon

a beautiful hit counter

Email
Submitted on: 2/3/2001 7:01:46 AM
By: Guy Munselle  
Level: Intermediate
User Rating: By 12 Users
Compatibility: ASP (Active Server Pages), VbScript (browser/client side)
Views: 32460
(About the author)
 
     Please rate my code!a hit counter that uses a daatabase and autonumber datatype to generate the next number each time your page is visited. You can change the background graphic to one of your own graphics

 
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
' for :a beautiful hit counter
'**************************************
copyright 2001 Actuate Internet Services, You may put this code on your page but MUST mention my website on the face of the page it is displayed on-visible by the common user by using this string> 
burn cd's online at www.itsmycd.com
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

2/6/2001 7:24:56 AMEugene

Guy, with this example, you will end up with a database of a million empty records. This seems like a lot of overhead just for a hit counter.
(If this comment was disrespectful, please report it.)

 
2/8/2001 12:29:25 PMMarc

Can you change the code to instead of adding a record to the database, you just edit the first record to add 1 to his value? I think it possible.
(If this comment was disrespectful, please report it.)

 
2/9/2001 8:01:10 AMPaul

Gee... I didnt know everyone was so desperate for a hit counter! Ill upload my -2 BYTE- one!
(If this comment was disrespectful, please report it.)

 
5/29/2001 1:54:17 AMSam Moses

I don't believe you wrote this code for a second. If you did, you would probably know not to put an HTML comment inside your ASP base code.
(If this comment was disrespectful, please report it.)

 
10/21/2001 5:50:10 AMSteve

Rather a lot of work for such a simple task.
(If this comment was disrespectful, please report it.)

 
5/15/2002 6:37:25 PMrakesh

with some changes its workin fine. could u mail n tell me if i can use this on my site. rakesch@rediffmail.com
(If this comment was disrespectful, please report it.)

 
6/5/2002 3:23:44 AMxmetrix@aol.com

how about since it's gonna create a huge amount of records (10,000+ hits a day) why not just make it log the date, time, ip, etc by adding fields to the database then setting the rs(
(If this comment was disrespectful, please report it.)

 
6/5/2002 3:29:10 AMxmetrix

rs('IP')= request.servervariables('REMOTE_ADDR') and whatnot if you want the code, i've got an updated code that adds ip, client info, and whatnot. hit me up at xmetrix@xmetrix.net
(If this comment was disrespectful, please report it.)

 
8/2/2002 3:33:39 PMLewis Moten

Two SQL Statments can help limit the number of records to just one.

UPDATE table1 SET Hits = Hits + 1

SELECT Hits FROM table1
(If this comment was disrespectful, please report it.)

 
2/4/2004 4:31:51 AMZubeer

It does not work to me. So sad.
(If this comment was disrespectful, please report it.)

 
9/11/2006 7:12:23 AM

not bad
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.