Anyone know the code for a basic hit counter? google brings up a load of crap
Anyone know the code for a basic hit counter? google brings up a load of crap
Get back imma let my gat go,
got a itchy finger... imma leave a fat hole.
- Giggs :: Ruthless Freestyle
I owe rep to - .:Jack120:. HabbDance
for really extremely basic, just everytime on page load update a value in mysql +1 and then retrieve it to display it.
How could this hapen to meeeeeeeeeeeeeee?lol.
http://www.developingwebs.net/phpclass/hitcounter.phpPHP Code:<?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];
?>
Lets set the stage on fire, and hollywood will be jealous.
/\ hard way around a simple solution...
||
How could this hapen to meeeeeeeeeeeeeee?lol.
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.http://www.developingwebs.net/phpclass/hitcounter.phpPHP Code:<?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];
?>
Get back imma let my gat go,
got a itchy finger... imma leave a fat hole.
- Giggs :: Ruthless Freestyle
I owe rep to - .:Jack120:. HabbDance
Last edited by Hitman; 16-03-2008 at 07:41 PM.
Get back imma let my gat go,
got a itchy finger... imma leave a fat hole.
- Giggs :: Ruthless Freestyle
I owe rep to - .:Jack120:. HabbDance
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.
How could this hapen to meeeeeeeeeeeeeee?lol.
Want to hide these adverts? Register an account for free!