Einzelnen Beitrag anzeigen
Alt 20.01.2002, 08:20   #6
Philipp
verXENt
 
Benutzerbild von Philipp
 
Registriert seit: 01.08.1999
Beiträge: 7.084

Mein Computer

Standard

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($fd2)) {
      
$count fgets($fd,100); 
      (!
$count) ? $count=$count++;
      
rewind ($fd);
      
fwrite ($fd$count); 
 } else { 
      echo 
"Fehler! Kann nicht auf die Datei $countfile zugreifen";
      exit;
}
flock($fd3);
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;
?>
Philipp ist offline   Mit Zitat antworten