<b><?
$ip = getenv ("REMOTE_ADDR");
if( file_exists("ip/$ip.ip"))
{
$lesaus = file("counter.dat");
echo"$lesaus[0]";
}
else
{
$lesaus = file("counter.dat");
$lesaus[0]++;
$datei = fopen("counter.dat","r+");
$datenm="$lesaus[0]";
rewind($datei);
fwrite($datei,$datenm);
fclose($datei);
echo"$lesaus[0]";
$file = fopen("ip/$ip.ip","w+");
$datenm="$ip";
fwrite($file,$datenm);
fclose($file);
}
?>
Besucher
<p style="margin-top: 0; margin-bottom: 0">
<?php
$datei = "hits.txt";
if (file_exists($datei)) {
$oeffnen = fopen($datei, "r");
$zahl = fread($oeffnen, filesize($datei));
fclose($oeffnen);
print "$zahl Seitenaufrufe";
if (is_writeable($datei) && ($zahl>0)) {
$oeffnen = fopen($datei, "w");
$zahl++;
fwrite($oeffnen, $zahl);
fclose($oeffnen);
}
}
?>
<p style="margin-top: 0; margin-bottom: 0">
<?
echo '<body>';
$count=0;
$time = time();
$ip = getenv(REMOTE_ADDR);
$text=$time."#".$ip."\n";
$filename="useronline.dat";
$zeile = file($filename);
$fp = fopen($filename , "w");
ftruncate ($fp, 0);
rewind($fp);
foreach($zeile as $schreiben)
{
$array = explode("#",$schreiben);
if($ip==rtrim($array[1])){$vorhanden=1;}
if($array[0] > $time -600 & $ip!=$array[1])
{
fwrite ($fp, $schreiben, 750);
}
}
fclose($fp);
$id = filesize($filename);
if($vorhanden!=1 or $id==0){
$datei = fopen($filename,"a");
flock($datei,2);
fwrite($datei,$text,750);
flock($datei,3);
fclose($datei);
}
for($x=0;$x<count($zeile);$x++){$count=$count+1;}
echo '<font class=textus>'; echo $count;echo ' online</font>';
?>