PHP counter for free

PHP counter for free

am 04.10.2007 09:50:49 von shror

I want to create a counter for free to my users, so that anybody could
generate a small piece of code and add it to his website and by this
way they run their own counters for free
is there a simple way or a ready made php script that could do this.

If anybody could tell me how to do it or the steps will be really
appreciated.

shror

Re: PHP counter for free

am 04.10.2007 12:06:46 von Erwin Moller

shror wrote:
> I want to create a counter for free to my users, so that anybody could
> generate a small piece of code and add it to his website and by this
> way they run their own counters for free
> is there a simple way or a ready made php script that could do this.
>
> If anybody could tell me how to do it or the steps will be really
> appreciated.
>
> shror
>

Hi shror,

That is not really complicated.
But you'll have to be clearer.
Do you want to store in a database?
Do you want a counter that counts every page, or just hits on a domain?

If you are new to PHP, I would advise you to use something like google
analitics for your sites. (urchin tracker)
You only need to add a small piece of Javascript to your pages of
interest, and make a (free) account at google per domain you want to track.

The result will be a much more professional reporting than a simple counter.

Of course, if you want to make a counter because you want to learn how
to do it in PHP, just ask again, and we will get you going.

Regards,
Erwin Moller

Re: PHP counter for free

am 04.10.2007 13:39:57 von James Barrett

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

shror wrote:
> I want to create a counter for free to my users, so that anybody could
> generate a small piece of code and add it to his website and by this
> way they run their own counters for free
> is there a simple way or a ready made php script that could do this.
>
> If anybody could tell me how to do it or the steps will be really
> appreciated.
>
> shror
>
I wrote a counter in php that counts unique ip addresses. Probably more
complicated that you are looking for, but still only a few lines of
code. You need a way to maintain persistent data on the server. The most
popular way to do that with php is to use a MySQL table.

Good luck,

Jim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHBNENQuDJiZ/QrH0RAmLjAJ9eNOvIcjq2VZx1CabNMe02smnP/ACf afYG
jENpBQoBQ0kfCqtkfe3dr4A=
=dn9k
-----END PGP SIGNATURE-----

Re: PHP counter for free

am 05.10.2007 20:29:20 von shror

On Oct 4, 1:39 pm, James Barrett wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> shror wrote:
> > I want to create a counter for free to my users, so that anybody could
> > generate a small piece of code and add it to his website and by this
> > way they run their own counters for free
> > is there a simple way or a ready made php script that could do this.
>
> > If anybody could tell me how to do it or the steps will be really
> > appreciated.
>
> > shror
>
> I wrote a counter in php that counts unique ip addresses. Probably more
> complicated that you are looking for, but still only a few lines of
> code. You need a way to maintain persistent data on the server. The most
> popular way to do that with php is to use a MySQL table.
>
> Good luck,
>
> Jim
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFHBNENQuDJiZ/QrH0RAmLjAJ9eNOvIcjq2VZx1CabNMe02smnP/ACf afYG
> jENpBQoBQ0kfCqtkfe3dr4A=
> =dn9k
> -----END PGP SIGNATURE-----

Thank you for your help and to be much more clearer in my question,
what I want to do is that I want to provide anybody who have a website
a small counter to use on his website that the source of the cunter is
on my hosting area and just what the other websites have is a
javascript that calls a small text file located on my area to add
counts so that the users will be using a service offered for free by
my website, like the freecounters offered by the websites to anybody,
but what I want is just very simple way without registration or
anything, just copy and paste a small piece of code.

Thanks for your help in all ways.

shror

Re: PHP counter for free

am 05.10.2007 20:47:29 von klenwell

On Oct 5, 11:29 am, shror wrote:
> On Oct 4, 1:39 pm, James Barrett wrote:
>
>
>
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
>
> > shror wrote:
> > > I want to create a counter for free to my users, so that anybody could
> > > generate a small piece of code and add it to his website and by this
> > > way they run their own counters for free
> > > is there a simple way or a ready made php script that could do this.
>
> > > If anybody could tell me how to do it or the steps will be really
> > > appreciated.
>
> > > shror
>
> > I wrote a counter in php that counts unique ip addresses. Probably more
> > complicated that you are looking for, but still only a few lines of
> > code. You need a way to maintain persistent data on the server. The most
> > popular way to do that with php is to use a MySQL table.
>
> > Good luck,
>
> > Jim
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.6 (GNU/Linux)
>
> > iD8DBQFHBNENQuDJiZ/QrH0RAmLjAJ9eNOvIcjq2VZx1CabNMe02smnP/ACf afYG
> > jENpBQoBQ0kfCqtkfe3dr4A=
> > =dn9k
> > -----END PGP SIGNATURE-----
>
> Thank you for your help and to be much more clearer in my question,
> what I want to do is that I want to provide anybody who have a website
> a small counter to use on his website that the source of the cunter is
> on my hosting area and just what the other websites have is a
> javascript that calls a small text file located on my area to add
> counts so that the users will be using a service offered for free by
> my website, like the freecounters offered by the websites to anybody,
> but what I want is just very simple way without registration or
> anything, just copy and paste a small piece of code.
>
> Thanks for your help in all ways.
>
> shror

I used a package called pphlogger for a while. It worked well enough
but as it's no longer actively maintained, I recommend it as a
reference more than a ready-to-roll solution:

http://pphlogger.phpee.com/download.php

I've been working on my own site metric. Development is being done
recreationally and it's still pre-alpha. But the basic parts have
been tested and it's the same concept you describe (using mysql on the
backend) so it, too, may be useful as a reference:

http://bafflegate.googlecode.com/svn/trunk/

If you want to offer it as a service to others, it's probably going to
have to be a little less simple than you'd hope -- especially if you
want to distinguish between visitors (sessions) and hits and the like.

But maybe somebody knows of a more reliable pre-existing solution.
Maybe search phpclasses.org.

Tom

Re: PHP counter for free

am 05.10.2007 22:30:25 von Hans-Peter Sauer




<1191608960.086891.219150@22g2000hsm.googlegroups.com>

> to be much more clearer in my question,
> what I want to do is that I want to provide anybody who have a website
> a small counter to use on his website that the source of the cunter is
> on my hosting area and just what the other websites have is a
> javascript that calls a small text file located on my area to add
> counts so that the users will be using a service offered for free by
> my website, like the freecounters offered by the websites to anybody,
> but what I want is just very simple way without registration or
> anything, just copy and paste a small piece of code
>

Javascript is a bad idea as some users disable it for security reasons .

The good news is you can do it using a url like
http://www.poop.com/hc/username as all the end user webpage would be
doing is pulling a stored number from your own website .

Your own website would be doing the 1+1 and storing the hit / count .


--
www.vhit.co.uk
www.phpwhois.co.uk
www.outerlimitsfan.co.uk
www.cannabiswindow.co.uk

Re: PHP counter for free

am 05.10.2007 22:55:15 von Hans-Peter Sauer






> > to be much more clearer in my question,
> > what I want to do is that I want to provide anybody who have a website
> > a small counter to use on his website that the source of the cunter is
> > on my hosting area and just what the other websites have is a
> > javascript that calls a small text file located on my area to add
> > counts so that the users will be using a service offered for free by
> > my website, like the freecounters offered by the websites to anybody,
> > but what I want is just very simple way without registration or
> > anything, just copy and paste a small piece of code
> >
>
> Javascript is a bad idea as some users disable it for security reasons .
>
> The good news is you can do it using a url like
> http://www.poop.com/hc/username as all the end user webpage would be
> doing is pulling a stored number from your own website .
>
> Your own website would be doing the 1+1 and storing the hit / count .
>



As the chances are the user wont be using .php webpages then