EASY hit counter

liunx

Guest
I'm not looking for anything that logs visits or anything fancy. Just want a simple text (or graphical if I must) counter for the index page only. We provide logs for our clients but one of them wants a counter so it shows his visitors how popular his site is.<br />
I've searched for a js on a1 (to no avail) and did a search on this site & found a lot of resources for counters that use databases & stuff. Is there not a simpler counter I can use? I tried using something FrontPage has but it didn't seem to work and I'd rather not rely on a FP component.<br />
Pls help! TIA.<br />
sb<!--content-->don't know how or if you can do it in javascript, you can however do it in php with no database, or you can Download <!--more--> a php script from here (<!-- m --><a class="postlink" href="http://www.hotscripts.com/search/?query=counter&category=PHP&bool=AND">http://www.hotscripts.com/search/?query ... P&bool=AND</a><!-- m -->) that'll do the trick, putrid counter looks quite simple (pity about the name :P )<!--content-->there's a million simple hitcounters online. bravenet.com has one. a simple google search should turn up about a 90% ratio of decent links for a simple javascript counter.<!--content-->leoo - i'm not sure if i'm reading it correctly or not - but doesn't the putrid counter just create a file w/ a counter in it? i'm not versed in php so i'm not sure - but that's what it looks like. all i want is a simple counter that will be displayed at the bottom of the page.<br />
<br />
transmothra - i checked out bravenet.com & they all seemed to be logging-type counters. since i have logs i'm not interested in using a counter that does that - just something that counts each time the page is hit. i don't think it can be done w/ js (after reading other common threads). i'm hoping to find an easy pearl script - but i'm still searching! thanks for the help.<!--content-->There should be tons of Perl ones available through the first link...<br />
<!-- m --><a class="postlink" href="http://www.hotscripts.com">http://www.hotscripts.com</a><!-- m --><br />
<br />
Or there is one here too...<br />
click (<!-- m --><a class="postlink" href="http://www.htmlite.com/script001.php">http://www.htmlite.com/script001.php</a><!-- m -->)<br />
(requires Perl and SSI)<!--content-->you're almost there, all it is you have a piece of php code on your page, which writes the hits to a flat file, at the same time displaying the number of hits in a counter, problem with this is you would have to rename you index to a .php extension (unless you configured you server to parse .html as .php), easier would be to use a cgi (<!-- m --><a class="postlink" href="http://www.hotscripts.com/Perl/Scripts_and_Programs/Counters/Image_Based/">http://www.hotscripts.com/Perl/Scripts_ ... age_Based/</a><!-- m -->) counter like htmlite said.<br />
A remotely hosted counter is by far the easiest just it also acts as a link to the counter host.<!--content-->You could try theCounter.com instead.<br />
<br />
<br />
If you sign up for TheCounter, then ditch their non-compliant code and replace it with:<br />
<br />
<!-- Start of TheCounter.com Code --><br />
<script type="text/javascript" language="javascript"><!--<br />
s="na";c="na";j="na";f=""+escape(document.referrer)<br />
//--></script><br />
<script type="text/javascript" language="javascript1.2"><!--<br />
s=screen.width;v=navigator.appName<br />
if (v != "Netscape") {c=screen.colorDepth}<br />
else {c=screen.pixelDepth}<br />
j=navigator.javaEnabled()<br />
//--></script><br />
<script type="text/javascript" language="javascript"><!--<br />
function pr(n) {document.write(n,"\n");}<br />
NS2Ch=0<br />
if (navigator.appName == "Netscape" &&<br />
navigator.appVersion.charAt(0) == "2") {NS2Ch=1}<br />
if (NS2Ch == 0) {<br />
r="&size="+s+"&colors="+c+"&referer="+f+"&java="+j+""<br />
pr("<a href=http://www.htmlforums.com/archive/index.php/\"http://www.TheCounter.com/\" target=\"_top\"><img")<br />
pr("align=\"center\" border=\"0\" alt=\"TheCounter\"")<br />
pr("src=http://www.htmlforums.com/archive/index.php/\"http://c1.thecounter.com/id=000000000"+r+"\"></"+"a>")}<br />
//--></script><br />
<noscript><a href=http://www.htmlforums.com/archive/index.php/"http://www.TheCounter.com/" target="_top"><img<br />
src=http://www.htmlforums.com/archive/index.php/"http://c1.thecounter.com/id=000000000" align="center"<br />
border="0" alt="TheCounter"></a></noscript><br />
<!-- End of TheCounter.com Code --><br />
<br />
<br />
You will need to change the digits 000000000 to be your own ID number.<br />
There are two separate places in the code where this has to be done.<br />
<br />
The word CENTER can be changed to LEFT or RIGHT if you need a different<br />
alignment of the image. There are two places that this needs to be done.<br />
<br />
Make sure you refer to the correct server. Find the two c1.thecounter.com<br />
entries and change these to match the one your account is on. This may be<br />
c1.thecounter.com or c2.thecounter.com or even c3.thecounter.com perhaps.<!--content-->whenever i have a real problem like this, i do the cheap thing (or i ask you guys). make a page with geocities and make a hit counter, then copy and paste the code.. hehe...<!--content-->
 
Back
Top