TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   Stat System (http://www.talkphp.com/general/329-stat-system.html)

truggler 04-10-2007 04:16 PM

Stat System
 
On my upcoming site I am going to try something new, but I am unsure about how to go about laying it out and programming it. I am looking for some help here and methods to be listed...

I want to have a system where I give out a script to my users, this script counts pageviews and returns it (with site id) to my MySQL database, where I will then rank there site amognst others to produce a top ten and low ten.

I was thinking about an include(); but this would make it easy for my members to get my database credentails and therefore edit there count / or hackers could get in this way.

My basic principal is this:
> Script given to user with site id on it (this is the script i need help with)
> Script then gets site id and +1 to their pageview count

Alex

AlEast 04-10-2007 06:40 PM

You could do what some systems do and use an image that is dynamically generated on your server. a normal <img src="someuri/image.jpg"> you have to on your side tell your server that for that image.jpg process some code. You will have the domain that called it so you don't really need to pass the siteid. And you can generate the image ( load it from file ) and echo it out. They see the image on their side, but you process the information how you wish.

truggler 04-10-2007 07:39 PM

cool idea,
but how would i differentiate between each user?
Alex

AlEast 04-11-2007 01:47 PM

The referrer I would imagine would be unique for each of your customers.

domain1
domain2
domain3

but if not I'm sure you could pass an id to the img src


All times are GMT. The time now is 07:37 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0