# Web site counter



## colorado97 (Mar 17, 2004)

Was wondering if anyone could suggest an easy to use, easy to set up web site counter for a site that can run PHP and MySQL. It would also be nice if the counter didn't require the web pages to have a .php extention for the filename (i.e., be able to work where filenames have a .htm or .html extension). I would also prefer a counter that doesn't utilize cookies.


----------



## JessieH (Jun 10, 2004)

I am just a beginner when it comes to creating webpages, and I am not quite sure what PHP and MySQL require (see my experience level lol). But when I made my webpage www.bravenet.com was very useful for me, and I know there is a counter on it. I also know you can load it onto an .html page.

I apologize if it's not what you are looking for


----------



## Rockn (Jul 29, 2001)

Google is a wonderful tool. "PHP counter" enter

http://www.askwebmaster.com/36.html


----------



## Big-K (Nov 22, 2003)

Why would it have to be php anyways? 
I agree. Google. If it were just a counter, then you could put in 'counters', or 'site statistics', or 'cookie-free counter'.


----------



## colorado97 (Mar 17, 2004)

Thanks for your suggestions. I was hoping however that someone had experience with a specific web site counter and could specifically recommend one that would have the features I listed previously. If you have a specific recommendation for a counter that could be set up on server space that supports PHP and MySQL and is easy to install I would still be interested.


----------



## Rockn (Jul 29, 2001)

If you want it to support PHP and MySQL the page is going to have to be programmed in PHP. The particular script I mentioned uses a text file that has the content editied by a adding one each time a new user accesses the page. You could edit it to use a database table quite easily and increment that values there. Why are you so adamant about the page the counter is on not being displaued in the URL as a PHP page? There are ways to hide content and underlying URL's by using Frames and IFrames that call a PHP page. If you want to count unique visitors to your site insted of the same people accessing it over and over again cookies are a good way (not perfect) to distinguish unique or first time visitors.


----------



## colorado97 (Mar 17, 2004)

I'm not really concerned about hiding anything. I just wanted to make sure the counter did not require the page to be written in php in order to work. Since posting the message today, I've been experimenting with two counters but they're not quite as comprehensive and still under development. The two that I've tried so far are: 
PHPSiteStats
http://phpsitestats.sourceforge.net/
InstaCounter
http://www.bramstart.be/ibwds/index.php?script=instacounter_v1.0

Both work pretty well. I like the PhpSiteStats; however, with the PhpSiteStats the code for html pages only displays a graphic showing a graph rather than the number of hits to the page. If my index page were written in PHP for example, then the number of hits could be shown.

And InstaCounter was quite easy to install and works well, but doesn't offer as many statistics as I'd like to view. I'd be interested in knowing if anyone knows of similar programs with comprehensive stats and that are easy to install.


----------



## conlieu (Apr 1, 2003)

Check out http://www.bcentral.com/default.asp. I use their free counter. Not sure if this is what you are looking for...


----------



## bassetman (Jun 7, 2001)

conlieu said:


> Check out http://www.bcentral.com/default.asp. I use their free counter. Not sure if this is what you are looking for...


I don't see anything about a counter on your link


----------



## PunkRockRyan (Oct 17, 2004)

Right, go into note pad and type the numebr you wish your counter to start at, then save it as counter.txt upload it to your server and put the code below where you want the counter. You also have to CHMOD it to 666 or 777,
This may sound complicated, but it's well worth having your own counter instead of using someone elses. Yeah, this does need a .php file extention, but in my view it's worth it.
This isn't quite what you where looking for but it could help :}
Good Luck :up: 

```
<?php

    $file="counter.txt";

    $handle=fopen($file, "r+");

    $hits=fread($handle,filesize("$file"));

    $hits+=1;

    fclose($handle);

    echo "$hits";

    $handle=fopen($file, "w");

    fwrite($handle, $hits);

    fclose($handle);

    ?>
```


----------



## bassetman (Jun 7, 2001)

PunkRockRyan said:


> Right, go into note pad and type the numebr you wish your counter to start at, then save it as counter.txt upload it to your server and put the code below where you want the counter. You also have to CHMOD it to 666 or 777,
> This may sound complicated, but it's well worth having your own counter instead of using someone elses. Yeah, this does need a .php file extention, but in my view it's worth it.
> This isn't quite what you where looking for but it could help :}
> Good Luck :up:
> ...


Thanks

I know how to chmod in Linux/UNIX, but in 2002 it is different. When I click on that file and click "set permissions" it tells me I haven't selected a Dir or file


----------



## PunkRockRyan (Oct 17, 2004)

Are you right clicking on the counter.txt file? and making sure the page is .php?


----------



## bassetman (Jun 7, 2001)

PunkRockRyan said:


> Are you right clicking on the counter.txt file? and making sure the page is .php?


.
You mean after it is uploaded?
I do save it as a text file right?


----------



## PunkRockRyan (Oct 17, 2004)

yeah you save it as txt file
isn't it working?
And yes after it's uploaded


----------

