NameSilo

Hit Counter Hosting.

Spaceship Spaceship
Watch

MixedByDJs

Account Closed
Impact
0
Hi all.

Im currently in development of a website that will be hosting free Web Tools for webpages. I would like to create my own script for hosting Hit Counters but am i bit baffled by it.

I can program in php and i can use SQL, but the question is, how would it work? Would i need to use SQL? I will want to bring up Stats aswell, so the user can check page stats.

Could someone clear up my idea and try to explain how it all works please.

So far i got the idea that a user will register, it will create a new Database entry then output a link to the Hit Counter. Everytime someone visits the users site it will log it and change the .gif image to update the hits.

What im not getting is how does it all work. Is the user just hosting the .GIF file? So lets say his hit counter is called '1238_jon_webhit.gif' and the image is showing '2000' hits, when a new user hits his site, the .gif will automaticlly overwritter with '2001' hits?

Please i need help on this :)
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable DomainsUnstoppable Domains
You can set up the MySQL so that there is a table called 'hits.' In hits, there are 2 fields: Name and Hits. (Of course, you can add fields if you wish, for ip, date, etc.)

To update the MySQL, it is very simple. Somewhere on the page, add the following:
Code:
mysql_query("UPDATE hits SET hits=(hits+1) WHERE id = '$id'") or die (mysql_error());

I'm not 100% sure, but if you set a setting in your .htaccess, it will make php files act as images. I haven't done much with image manipulation, so I was probably wrong.. :D
 
0
•••
You would also probably need javascript, you dont want people to have to include a live php file from your server because it will cause them problems if your server is ever down.
 
0
•••

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back