PDA

View Full Version : Hit COunter



Gangster
16-03-2008, 06:45 PM
Anyone know the code for a basic hit counter? google brings up a load of crap

L!nK..
16-03-2008, 06:47 PM
http://www.freestatscounter.com/free-counter.php

Hypertext
16-03-2008, 06:48 PM
for really extremely basic, just everytime on page load update a value in mysql +1 and then retrieve it to display it.

Bojangles
16-03-2008, 06:50 PM
http://www.habboring.com/counter/

Decode
16-03-2008, 06:51 PM
<?php
$count_my_page = ("hitcounter.txt");
$hits = file($count_my_page);
$hits[0] ++;
$fp = fopen($count_my_page , "w");
fputs($fp , "$hits[0]");
fclose($fp);
echo $hits[0];
?>

http://www.developingwebs.net/phpclass/hitcounter.php

Hypertext
16-03-2008, 06:54 PM
/\ hard way around a simple solution...
||

Gangster
16-03-2008, 06:59 PM
http://www.freestatscounter.com/free-counter.php
Nah, i dont want one with a background

http://www.habboring.com/counter/
goes up everytime you refresh.



<?php
$count_my_page = ("hitcounter.txt");
$hits = file($count_my_page);
$hits[0] ++;
$fp = fopen($count_my_page , "w");
fputs($fp , "$hits[0]");
fclose($fp);
echo $hits[0];
?>http://www.developingwebs.net/phpclass/hitcounter.php
i want a html code. Because when i paste that where i want it on dw, it comes up as a box with php in it.

Decode
16-03-2008, 07:00 PM
Nah, i dont want one with a background

goes up everytime you refresh.


i want a html code. Because when i paste that where i want it on dw, it comes up as a box with php in it.
You cant get a html hit counter...

Gangster
16-03-2008, 07:03 PM
You cant get a html hit counter...
kk .

Edited by Hitman (Forum Moderator): Please don't post pointlessly.

Hypertext
16-03-2008, 07:03 PM
it will come up as a box with php in it, as you're not on a server, php is server side code, and cannot be used offline.

Decode
16-03-2008, 07:04 PM
kk .
If you want to use php, get wamp.

Hypertext
16-03-2008, 10:45 PM
Just sue freehostia

Want to hide these adverts? Register an account for free!