I Need a Simple Hit Counter

For system help, all hardware / software topics NOTE: use Coders Corner for all coders topics.

Moderators: Krom, Grendel

Post Reply
User avatar
Spidey
DBB Grand Master
DBB Grand Master
Posts: 10808
Joined: Thu Jun 28, 2001 2:01 am
Location: Earth

I Need a Simple Hit Counter

Post by Spidey »

I need a nice simple reliable page/site hit counter, the kind that simply goes into a CGI-BIN folder, and is displayed with a simple HTML image tag, or such.

It would be nice if the size, color & font could be set could be set with the HTML tag.

Requirements…

1. Its needs to only increment the count only when the site is visited from absolute urls, not from relative ones. (can’t be incremented by returning from same site pages)

2. No need for cookies, no need for unique visits, etc.

3. Should be coded in a common script, like ASP, or PHP, etc.

What I need…

1. The Script itself.
2. Sample HTML tag.
3. Some basic instructions, such as resetting or starting at a specific count, etc.
4. The trigger code, and any codes for viewing the counter without incrementing it.

Free would be nice, but paying a small price is not a deal breaker.

Thanks in advance
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6539
Joined: Sun Sep 05, 1999 2:01 am
Location: ❄️❄️❄️

Post by Jeff250 »

Are you familiar with programming in general? This is really a perfect introductory php project. The simplest incarnation would read the count from a flat text file, and then check the visitor's referrer to see where she came from. (Referrer isn't trustworthy, but it's good enough.) If her referring url is from outside your site, then increment the counter and write the new count to the flat text file. Lastly, if desirable, display the count; otherwise, you're done.
User avatar
Spidey
DBB Grand Master
DBB Grand Master
Posts: 10808
Joined: Thu Jun 28, 2001 2:01 am
Location: Earth

Post by Spidey »

Thanks, but I’m looking for a pre made counter, like the one my old host supplied.
User avatar
fliptw
DBB DemiGod
DBB DemiGod
Posts: 6459
Joined: Sat Oct 24, 1998 2:01 am
Location: Calgary Alberta Canada

Post by fliptw »

where is this being hosted?
User avatar
AlphaDoG
DBB Admiral
DBB Admiral
Posts: 1345
Joined: Sun Dec 25, 2005 10:35 am
Location: Mt. Vernon Illinois

Post by AlphaDoG »

It's never good to wake up in the shrubs naked, you either got way too drunk, or your azz is a werewolf.

Image
User avatar
Spidey
DBB Grand Master
DBB Grand Master
Posts: 10808
Joined: Thu Jun 28, 2001 2:01 am
Location: Earth

Post by Spidey »

The site is hosted by a company called PAETEC (I think, will look it up, if it matters) why?

AlphaDog. I don’t want my counter hosted off site. And I have already searched my azz off, just figured maybe someone here could make a suggestion.
User avatar
Spidey
DBB Grand Master
DBB Grand Master
Posts: 10808
Joined: Thu Jun 28, 2001 2:01 am
Location: Earth

Post by Spidey »

Ok, so the requirement to not increment the counter when returning to the home page, is now not needed, because I have a good workaround, by using a meta refresh page, as Index.html then moving on to a page that won’t have the counter on it. (pretending to be the home page)

So I figure most recounts can be avoided, by using the navigation buttons, and the few that hit by using the back button, I’m not going to worry about.

Most browsers do support meta refresh correct?
User avatar
AlphaDoG
DBB Admiral
DBB Admiral
Posts: 1345
Joined: Sun Dec 25, 2005 10:35 am
Location: Mt. Vernon Illinois

Post by AlphaDoG »

You could call a javascript that resides on your page to do the work you need. Was my point.
It's never good to wake up in the shrubs naked, you either got way too drunk, or your azz is a werewolf.

Image
Post Reply