Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
hi all ,
i made a hit counter in frontpage , and put it in the bottom of the page, but don't know why its not working ... any help ?www.lala-bekaa.com
thanks
Peace !!

lol, dont ya just hate those things!?! i have this script that i created for use in php, if your webserver has access to php you could use this.
//Author: Dylan Jess
<?php
/* counter */
$datei = fopen("countlog.txt","r"); //opens countlog.txt to read
$count = fgets($datei,1000);
fclose($datei);
$count=$count + 1;
$datei = fopen("countlog.txt","w"); // opens to write and deletes the old count
echo "<**bold**>$count<**/bold**>";
fwrite($datei, $count);
fclose($datei);
/* tracker */
$filename = "tracker.htm";
$fp = fopen($filename,"a");
$ip = $_SERVER['REMOTE_ADDR'];
$date = date("m.d.Y @ g:i a");
fputs($fp,"$
");
fclose($fp);
?>i just made this script like 10 minutes ago, ill be making it easier to read on the tracker part and will post back when i finish. that works pretty much fine though.
if you use the script, please include the signature. thanksFBI_Agent

It won't work till you save and publish your site. Mine work fine on all 59 of my pages. And on about 20 more pages on other sites I made and host for other companies.

here is a simple one which I wrote for my site.
<?
$file=fopen("./counter.dat","r+");
fscanf($file,"%d",$counter);
if($counter=="")$counter=0;
print "$counter";
$counter=$counter+1;
rewind($file);
fwrite($file,$counter,100);
fclose($file);?>
You may like to make the output more fancy by using HTML in the print statement

PS : if you want us to tell you why your counter doesnt work you gotta tell us how you implemented it. Post the code if possible

The counter doesnt work because most likely the server doesnt have frontpage extentions enabled....Thats all...
http://excellhosting.net for all your hosting needs.

thanks all for your support...
i will try your php codes .. :)
and yes my host have frontpage extension installed.
and how implemnted it ...
i just put .. add counter .. and it got added ... its frontpage ...and it was working , i edited the local news , and re upload , and it stoped working ..
and yes , i know i have to publish it to work , i published it , and its not working yet ...
thanks all for support.. :)
peace !!

When you edited your local news page was the counter showing a box with a red x in it? When this happens you have to click on it and renew its values. You just have to click on it and pick the counter you want again. Your numbered views are usually still set in the counter box.

![]() |
Change content automatica...
|
MCAD readiness eval
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |