Page 1 of 1

[SOLVED] Counter Problem...

Posted: Tue Jan 11, 2005 5:36 am
by Dale
Nice New Style :D

I'm using a counter off a site, which had it as a tutorial. Im sorry but i cannot rmember where i got it from however when i place it on a page it counts two hits instead of just one hit.

Code: Select all

<?php
echo "<center><font face="verdana" size="1">";

$counthandle=fopen("sample.php","r");
$getcurrent=fread($counthandle,filesize("sample.php")); 
$getcurrent=$getcurrent+1; 

fclose($counthandle);
$counthandle1=fopen("sample.php","w");
fputs($counthandle1,$getcurrent);

fclose($counthandle1);
$counthandle2=fopen("sample.php","r");
$getrecent=fread($counthandle2,filesize("sample.php"));

print "$getrecent";

fclose($counthandle2);
echo "</center></font>";
?>
tags dont work :(

Could someone tell me where im going wrong.

Posted: Tue Jan 11, 2005 5:42 am
by onion2k
Two questions..

1. Is there a broken image on the page anywhere?

2. Are you using Firefox?

If thats a possible combination then I reckon that'll be the issue. If you have an image without a src then FF requests the calling page again. At least, it does on one of my sites..

Posted: Tue Jan 11, 2005 5:47 am
by Dale
Ahhh, yes i have broken images on there, well images that dont link anywhere (eg; src="." ) because I havent had the images sent to me yet... i'll give it a test without the images to see if it works.

[EDIT]
THANKS! That was the problem, it was caused by the broken images.