Jump to content

Free Web Counter Wich ?


Recommended Posts


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.

Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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