I tested your code on my local windows machine:
$file = "testFile.txt";
$fh = fopen($file, 'a+') or die("can't open file");
$firstname = "firstName"; $lastname = "lastName"; $mood = "mood";
$datestring = date("d/m/y ");
$timestring = date("H.i.s");
$data = "$firstname ; $lastname ; $mood ; $datestring : $timestring\r\n" ;
$data .= "$firstname ; $lastname ; $mood ; $datestring : $timestring\r\n" ;
fwrite($fh, $data);
fclose($fh);
and it printed:
firstName ; lastName ; mood ; 19/10/12 : 12.00.35
firstName ; lastName ; mood ; 19/10/12 : 12.00.35
to the testFile.txt
I also tested it on my remote unix based host and it gave exactly the same result. Maybe I can see all the code concerned?