@bubakJun 24.2009 — #I tried your original code, and it works fine if you open it in anything that is better than regular notepad, such as notepad2 or notepad++.#
To get it to display properly in notepad, I used this:
[code=php]fwrite($statfile,$string."rn");[/code]
Which is the reverse of what I gave you originally.