Hit Counter
  • 2006/2/24 16:30

  • iicky

  • Just popping in

  • Posts: 3

  • Since: 2006/2/24

Isn't there just a simple little hit counter you can place on your page, instead of all this stats stuff. Just a simple little counter would do. I can't seem to find one anywhere... Anyone?

Re: Hit Counter
  • 2006/2/24 17:09

  • luciano

  • Quite a regular

  • Posts: 261

  • Since: 2003/11/3


$user_ip $_SERVER['REMOTE_ADDR'] . "n";
$ip_list file($file);
$visitors count($ip_list) - 1;

if (
    echo (
    } else {
$fp fopen($file,"a");


upload this script and a .txt file with on the first line some text (just put the name of your site there), chmod the textfile 777 and that should do the job. It stores the ip's in the txt file.

I used it om www.dehaarspecialist.be (bottom right).

I know, it's not perfect but it does the job

Code credits: ??????????

Re: Hit Counter
  • 2006/2/24 17:09

  • zyspec

  • Module Developer

  • Posts: 1093

  • Since: 2004/9/21

I don't recall seeing a simple counter module anywhere.

What most people that just want a page load counter have done is to just put a script into a custom block. There's several GPL scripts available that will create a counter that will display the number of times the page (or block in this case) has been loaded.

Re: Hit Counter
  • 2006/2/24 17:11

  • barryc

  • Just can't stay away

  • Posts: 480

  • Since: 2004/3/20

I have used a simple cgi script to put a counter on a page or in a block. You can get the one I used athttp://perlwebsite.com/hitcounter.htm

Put the cgi script in your cgi-bin

Then on the page where you want to call it, put:

<script language="JavaScript" src="http://aka.org/cgi-bin/counter.cgi"></script> visitors etc., etc.

changing the text to suit your site. You can also call it from a custom block.

A little more elaborate is php-stats available athttp://www.phpstats.net. There is a FAQ for installing it athttps://xoops.org/modules/smartfaq/faq.php?faqid=529
Barry Cooper
Sweet Home, Oregon

Re: Hit Counter
  • 2006/2/24 20:08

  • iicky

  • Just popping in

  • Posts: 3

  • Since: 2006/2/24

Thanks everyone for a reply. Luciano, where exactly do you upload it to? in the root webserver directory right? Do i need to create a module or block for it too? Do i need to add any include statements anywhere in any of my other scripts?

Re: Hit Counter
  • 2007/5/4 8:12

  • brmecham

  • Just popping in

  • Posts: 35

  • Since: 2004/7/13

luciano, I am not exactly sure how to add this counter to my site, I created a counter.txt and a counter.php (with the php code you provided) and put those on my site. I want them to show up in the footer as yours does, the only way I know how is to add that to THEME.HTML, but that doesn't quite work - i tried it with a statement such as this:

<?php include ("counter.php"); ?>

it didn't work for me. not sure what else to try.


Who's Online

95 user(s) are online (71 user(s) are browsing Support Forums)

Members: 0

Guests: 95



Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits