Use of undefined constant REMOTE_ADDR - assumed...

rumchi

Registered
Имам проблем с брояч
<b>Notice</b>: Use of undefined constant REMOTE_ADDR - assumed 'REMOTE_ADDR' in <b>/www/1gb.bg/z/o/n/zone49/htdocs/count.php</b> on line <b>5</b><br />


Код на брояча:

<?php
$countfile = "count.dat";
$ipcounter = "today.dat";
$countdate = date("j-n-Y");
$visitorip = $_SERVER[REMOTE_ADDR];
$maxrecord = date("d.m.Y (H:i)");

if (!file_exists($ipcounter)) { $fp = fopen($ipcounter, 'w+'); }
if (!file_exists($countfile)) { $fp = fopen($countfile, 'w+'); fwrite($fp, "0|0|0|1|$countdate|0|$maxrecord"); }

$fcontents = file_get_contents($countfile);
list($today, $yesterday, $total, $days, $nowdate, $max, $nowrecord) = explode("|", $fcontents);

if($countdate != $nowdate) {
$ipfile2 = fopen($ipcounter, 'w');
$line = "$visitorip\n";
fwrite($ipfile2, $line, strlen($line));
fclose($ipfile2);

if($today > $max) { $max = $today; $nowrecord = $maxrecord; }
$yesterday = $today;
$today = 1;
$total++;
$days++;

$fp = fopen($countfile, 'w');
fwrite($fp, "1|$yesterday|$total|$days|$countdate|$max|$nowrecord");
fclose($fp);
}

else {
$ipfile = fopen($ipcounter, 'rb');
$line = array();
while (!feof($ipfile)) $line[]=fgets($ipfile,1024);
for ($i=0; $i<(count($line)); $i++) {
list($visitorip_x) = split("\n",$line[$i]);
if ($visitorip == $visitorip_x) {$found = 1;}
}
fclose($ipfile);

if (!$found) {
$ipfile2 = fopen($ipcounter, 'ab');
$line = "$visitorip\n";
fwrite($ipfile2, $line, strlen($line));
fclose($ipfile2);

$today++;
$total++;

if($today > $max) { $max = $today; $nowrecord = $maxrecord; }
$fp = fopen($countfile, 'r+');
fwrite($fp, "$today|$yesterday|$total|$days|$countdate|$max|$nowrecord");
fclose($fp);
}
}
if($days == 1) { $dendni = "ден"; }
else { $dendni = "дни"; }
?>

<div style="font-family:verdana;font-size:11px;color:white;">
<b>Уникални посещения:</b>
Днес <b><?php echo $today; ?></b> /
Вчера <b><?php echo $yesterday; ?></b> /
Общо <b><?php echo $total."</b> за <b>$days</b> ".$dendni; ?> /
</div>

Използвам 1gb.bg
http://zone49.1gb.bg/ Ето вижте и сорс кода ако искате

Някакви идеи как да оправя този проблем?
 

Горе