I have the following php code:
<?php //chose the file $file = 'C:\Program Files\EasyPHP-5.3.2i\www\test\dump.txt'; //open the file in writeable mode $data = fopen($file, 'w'); //add the new element to it fwrite($data, $data.'gagi'); //close the file fclose($data); ?>
I expect it to keep whatever is in the file and add 'gagi' (without quotes) to the file i referenced in $file. however, what it does is: it deletes everything in the file and puts in it the following: "Resource id #3gagi".
specifically, what I am trying to do is build a script that keeps track of when people sign in on a site (or network) that I control. something like a log file.
any help is much appreciated!
P.S. I also tried reading the file as an array, and then use array_push(), but it aint worked either.