Help - Search - Members - Calendar
Full Version: Free Web Counter Wich ?
MSFN Forums > Coding, Scripting and Servers > Web Development (HTML, Java, PHP, ASP, XML, etc.)

   
Google Internet Forums Unattended CD/DVD Guide
albator
free web counter wich ? I seek for one withoud ads..
matrix0978
You could probably make a counter withtout those freebies.
its PHP.

Put this code in your webpage whereever you want it
CODE
<?php
    include("count.php");
    ?>
<br>
<?

And then you need to make a .php file and put this code in
CODE
<?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.
albator
thank, but my hosting doe'Snt support php I think.
matrix0978
http://www.statcounter.com/free_hit_counter.html

and also look at google!!!!!!
sonu27
Is there not a mistake in you code; the first part?

Shouldn't it be ending in ?>
matrix0978
Either way is fine!
sonu27
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.
Google Internet Forums Unattended CD/DVD Guide
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.