Jump to content

Recommended Posts


Posted

You could probably make a counter withtout those freebies.

its PHP.

Put this code in your webpage whereever you want it

<?php
include("count.php");
?>
<br>
<?

And then you need to make a .php file and put this code in

<?php

$COUNT_FILE = "hitcounter.dat";

if (file_exists($COUNT_FILE)) {
$fp = fopen("$COUNT_FILE", "r+");
flock($fp, 1);
$count = fgets($fp, 4096);
$count += 1;
fseek($fp,0);
fputs($fp, $count);
flock($fp, 3);
fclose($fp);
} else {
echo "Can't find file, check '\$file'";
}

?>
<!- Hit Counter -->
<center>This page has been viewed <b><?php echo $count; ?></b> times<br>

and you need to make a file called 'hitcounter.dat' and put the number '0' in it(without quotes) and now your done.

  • 3 weeks later...
Posted

Ok, thanks.

Btw, I tried going on that sat counter site, but I guess my hosts file it blocking it. So never mind.

I haven't got php hosting so I could not try it.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...