PHP-Code:
<?php
...Code verkürzt.......
{
$file = fopen($name, "w");
if($file) {
fputs($file, "0#########");
fputs($file, "\r\n");
fputs($file, "\r\n");
fclose($file);
}
}
// Reload protection and daycounting
$useronline = 1;
$visitsyester = 0;
$visitsaday = 1;
$ipok = 1;
$datum = date("d.m.Y");
$datumyester = $last_week = date("d.m.Y", mktime(0,0,0, date(m), date(d)-1,date(Y)));
if(getenv("HTTP_CLIENT_IP")) {
$ipad = getenv("HTTP_CLIENT_IP");
} elseif(getenv("HTTP_X_FORWARDED_FOR")) {
$ipad = getenv("HTTP_X_FORWARDED_FOR");
} else {
$ipad = getenv("REMOTE_ADDR");
}
$ipad = substr($ipad, 1,15);
$file = fopen ($name, "r");
while (!feof($file)) {
$buffer = fgets($file, 4096);
// USRERONLINE INSTERT
if (strpos($buffer, 'T') == 15 ) {
$dayof = substr($buffer, 21,2);
$monthof = substr($buffer, 24,2);
$yearof = substr($buffer, 27,4);
$hourof = substr($buffer, 34,2);
$minof = substr($buffer, 37,2);
$secof = substr($buffer, 40,2);
$timerec = mktime($hourof, $minof, $secof , $monthof, $dayof, $yearof);
$realtime = time();
if (($realtime-$timerec) <= $useronlinetime) { if (strpos($buffer, $ipad) == false) {$useronline++;}} // refresh-counting protection
}
// DAYCOUNTER
if ($buffer <> '' ) {$lastline = $buffer;}
if (strpos($buffer, $datum) <> false)
{
if (strpos($buffer, $ipad) <> false) {$ipok = 0;}
if (strpos($buffer, $ipad) == false) {$visitsaday++;}
}
if (strpos($buffer, $datumyester) <> false)
{$visitsyester++; }
}
fclose ($file);
// end
// end
// HTML IP-LOGGER visitors data output
$HTTP_GET_VARS['showhtml'];
if ($showhtml == '' ) {$showhtml = '0';}
if ($showhtml == 1 )
{
$bgs = 0;
echo '
EDIT:
DAS SOLLTEST DU UNBEDINGT ÄNDERN.....Ich meine die Header Ausgabe, nicht was darunter folgt
PHP-Code:
debilsoft IP-LOGGER visitors data. (please wait while loading...)<br><br>
<table border="0" cellpadding="0" cellspacing="3" style="border-collapse: collapse" borderColor="#000000" width="1800">
<tr>
<td width="75"><b>Visitor</b></td>
<td width="129"><b>Time</b></td>
<td width="100"><b>IP</b></td>
<td width="300"><b>DNS-NAME</b></td>
<td width="590"><b>Browser</b></td>
<td width="400"><b>Referer</b></td>
</tr>';
$file = fopen ($name, "r");
...usw.
}
?>
Kommentar