...

View Full Version : Hit Count problem.



saeed
08-13-2007, 09:35 AM
Hello,
I downloaded a hit count script ... did some modifications ... its working fine on one of my domain but other one is showing me some errors... although am getting results below the errors..

Working fine (http://www.saeednagaria.net/count/counter.php)

Working fine with some errors (http://www.pcdc.org.pk/counter/counter.php)

additionally, I want to know how can i use it as includes ... I wont be copying script on every page.

Script contains two files .. counter.php and count.txt

herez the code.

<?
$filename = "count.txt";
$fp=fopen("$filename","r");
$count=fread($fp, filesize("$filename"));
fclose($fp);
$count++;
$fp=fopen("$filename","w+");
fwrite($fp,$count);
fclose($fp);
echo "This website has been accessed <sub>$count</sub> times.";
?>


any help will be appreciated.

thanks,

Saeed.

gemguy
08-13-2007, 10:18 AM
Hi,

Try some of these scripts.

http://www.hscripts.com/scripts/php/freeCounter.php

or

http://www.hscripts.com/scripts/php/usageStatistics.php

Come with feedbacks if any.

rafiki
08-13-2007, 12:04 PM
Hello,
I downloaded a hit count script ... did some modifications ... its working fine on one of my domain but other one is showing me some errors... although am getting results below the errors..

Working fine (http://www.saeednagaria.net/count/counter.php)

Working fine with some errors (http://www.pcdc.org.pk/counter/counter.php)

additionally, I want to know how can i use it as includes ... I wont be copying script on every page.

Script contains two files .. counter.php and count.txt

herez the code.

<?
$filename = "count.txt";
$fp=fopen("$filename","r");
$count=fread($fp, filesize("$filename"));
fclose($fp);
$count++;
$fp=fopen("$filename","w+");
fwrite($fp,$count);
fclose($fp);
echo "This website has been accessed <sub>$count</sub> times.";
?>


any help will be appreciated.

thanks,

Saeed.

it gives you a clue, Permission denied
try


chmod("/counter/count.txt", 0755);



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum