Fehlerhafter counter

Hi!

Hier die funktionierende Version eines Downloadcounters:

[code]

<?php $datei = fopen("counter.txt","r+"); $counterstand = fgets($datei, 10); if($counterstand == "") { $counterstand = 0; } $counterstand++; echo $counterstand; rewind($datei); fwrite($datei, $counterstand); fclose($datei); ?>[/code]

Wenn ich nun echo $counterstand; auskommentiere funktioniert das Skript nicht mehr richtig, da es auf einmal immer mit einem Aufruf 3 zum aktuellen Counterstand hinzuzählt:

[code]

<?php $datei = fopen("counter.txt","r+"); $counterstand = fgets($datei, 10); if($counterstand == "") { $counterstand = 0; } $counterstand++; //echo $counterstand; rewind($datei); fwrite($datei, $counterstand); fclose($datei); ?>[/code]

Warum zum Teufel ist das so???

Danke schonmal für eure Hilfe!

Funktioniert alles normal.

Außerdem: Wenn ein echo auskommentiert wird, kann die Funktion des Scriptes garnicht beeinflusst werden.

MfG, xcube

Hmmm… habs nicht hier getestet, sondern auf einem anderem Server.

Es ist ein QWeb Server. Vielleicht hat der da nen bug…