|
|
Hit Counter - simple hit counter | ||
Discussion by awarkops with 14 Replies.
Last Update: February 22, 2006, 10:01 am | |||
![]() |
|
|
PHP Code
QUOTE
<?php$file = 'counter.txt';
if(!file_exists($file))
{
$handle = fopen($file, 'w');
fwrite($handle, 0);
fclose($handle);
}
$count = file_get_contents($file);
$count++;
if(is_writable($file))
{
$handle = fopen($file, 'w+');
fwrite($handle, $count);
fclose($handle);
}
else
{
echo 'Could not increment the counter!<br />';
}
echo number_format($count).' Hits';
?>
open notepad and save it as counter.txt then upload it to the director you put the code on the php page a set the permission to 777
when adding this code to you page make sure you save you page as name.php
and not as name.htm or name.html or if you have php activation in html u can just save it as html
im cant remember how to activate php in html if some one can tell me it will help
This "tutorial" may be quite useful, but I'm afraid to say it can hardly count as a tutorial, since it doesn't teach one anything, nor does it explain what the individual parts mean or do.
QUOTE (awarkops)
ok just copy this code to the location you want the counter onPHP Code
open notepad and save it as counter.txt then upload it to the director you put the code on the php page a set the permission to 777
when adding this code to you page make sure you save you page as name.php
and not as name.htm or name.html or if you have php activation in html u can just save it as html
im cant remember how to activate php in html if some one can tell me it will help
that sounds cool and all. however i jsut dont like other people to see how many other people have visited my site. i like the hit counters taht jsut allow you so see how many people visited your site and at what time of teh day.
I recently searching for a hit counter aswell, and ended up finding one that records unique hits each day. So if someone was to Visit my site, it would count 1. No matter how many times they refreash with 24 hours, another hit won't be counted. But after 24 hours, it would raise to 2. It's pretty nice, was just a PHP counter, but it was good. But I ended up losing it, and not being able to find it.
Perhaps next time you could make one like this? I'm sure alot of people would like it aswell.
Thnx, apo!
Seems easy and simple, thanks.
Similar Topics:
Php Hit Counter
Php Unique Hit Counter
I Want A Good Hit Counter
Get Rid Off Recycle Bin From The Desktop plus bypass it if dont want to remove it (6)
|
(0) Ie Download Limit
|
Loading...
HOME 





Create a simple hit counter using PHP and MySQL Part 1
How to add a hit-counter to your Tumblr page (Voice tutorial with steps in description)
How to make a Click Counter in Visual Basic 2008
How To Make A Hit Counter In PHP
PHP MySQL Tutorial: Create a Simple View Counter -HD-

