Hier die Fassung mit Flock und Filehandler Überprüfung
PHP-Code:
<?php
$countfile = "count.dat";
(!file_exists($countfile)) ? $fd = fopen($countfile,"w+") : $fd = fopen($countfile,"r+");
if ($fd && flock($fd, 2)) {
$count = fgets($fd,100);
(!$count) ? $count=1 : $count++;
rewind ($fd);
fwrite ($fd, $count);
} else {
echo "Fehler! Kann nicht auf die Datei $countfile zugreifen";
exit;
}
flock($fd, 3);
fclose ($fd);
echo <<<site
<html>
<head>
<title>Gironimo's Site</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="styles.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#000000" vlink="#000000" alink="#000000">
<table width="100%" border=0 cellspacing=0 cellpadding=0 height=100% align=center>
<tr>
<td>
<div align="center">
[img]/images/gironimo.jpg[/img]</p>
<font color="#666666">[b]<font size="1" class="noformat">SEND ME AN
[email="gironimo20@gmx.at"]E-MAIL[/email]!</font>[/b]</font></p>
</div>
</td>
</tr>
<tr>
<td><div align="center">Sie sind der [b]" . $count . ".[/b] Besucher</div>
</td>
</tr>
</table>
</body>
</html>
site;
?>