but it is
i am useing the exact same code on 2 other web host and don't have this problem
one and only files has this (no other file access either these)
CODE
include ("hitlogger.php");
include ("uniquehits.php");
include ("uniquehits.php");
hitlogger.php's code
CODE
<?php
$count_my_page = ("count.log");
$hits = file($count_my_page);
$hits[0] ++;
$fp = fopen($count_my_page , "w");
fputs($fp , "$hits[0]");
fclose($fp);
?>
$count_my_page = ("count.log");
$hits = file($count_my_page);
$hits[0] ++;
$fp = fopen($count_my_page , "w");
fputs($fp , "$hits[0]");
fclose($fp);
?>
uniquehits.php's code:
CODE
<?
// Unique Hits PHP Script
// ----------- March 2004
// Contact author: uniquehits@sizzly.com
// for updates, visit:
// http://www.sizzly.com/uniquehits.htm
// CHMOD this file to 666
// If it doesn't work, try 777
$log = 'uniquehits.log';
// No need to edit anything below this line
// ----------------------------------------
$IP = getenv (REMOTE_ADDR);
$add = true;
$hits = 0;
if (!file_exists ($log)) {
echo "Error: $log does not exist.";
exit;
}
$h = fopen ($log, 'r');
while (!feof ($h)) {
$line = fgets ($h, 4096);
$line = trim ($line);
if ($line != '')
$hits++;
if ($line == $IP)
$add = false;
}
fclose($h);
if ($add == true) {
$h = fopen ($log, 'a');
fwrite($h, "
$IP");
fclose($h);
$hits++;
}
/*
eval(gzinflate(base64_decode('
JY1BCoMwEADvgn8IUthbQq/tZvMUiRK7oZq0cSXU
11fb8zAzjtC1TRg5q+7CUVYcCuGUk6g17sHCFQi9
4hImCyzyuhlTa9UH3OePHvNithTfWzhdzbKAEl8e
QSz0w+zTE+jP1S9uPKE569Td28Yd8y8=
')));*/
?>
// Unique Hits PHP Script
// ----------- March 2004
// Contact author: uniquehits@sizzly.com
// for updates, visit:
// http://www.sizzly.com/uniquehits.htm
// CHMOD this file to 666
// If it doesn't work, try 777
$log = 'uniquehits.log';
// No need to edit anything below this line
// ----------------------------------------
$IP = getenv (REMOTE_ADDR);
$add = true;
$hits = 0;
if (!file_exists ($log)) {
echo "Error: $log does not exist.";
exit;
}
$h = fopen ($log, 'r');
while (!feof ($h)) {
$line = fgets ($h, 4096);
$line = trim ($line);
if ($line != '')
$hits++;
if ($line == $IP)
$add = false;
}
fclose($h);
if ($add == true) {
$h = fopen ($log, 'a');
fwrite($h, "
$IP");
fclose($h);
$hits++;
}
/*
eval(gzinflate(base64_decode('
JY1BCoMwEADvgn8IUthbQq/tZvMUiRK7oZq0cSXU
11fb8zAzjtC1TRg5q+7CUVYcCuGUk6g17sHCFQi9
4hImCyzyuhlTa9UH3OePHvNithTfWzhdzbKAEl8e
QSz0w+zTE+jP1S9uPKE569Td28Yd8y8=
')));*/
?>
the stats are visible via hits.php
hits.php's code
CODE
<?
$x=file("count.log");
echo "Hits: " . $x[0];
echo "<br/>";
echo "Unique Hits: " . (count(file("uniquehits.log"))-1);/*1st line is blank*/
?>
$x=file("count.log");
echo "Hits: " . $x[0];
echo "<br/>";
echo "Unique Hits: " . (count(file("uniquehits.log"))-1);/*1st line is blank*/
?>
out put is
Hits: 336
Unique Hits: 2404
can anyone explain this
