I wrote a php script to determine when folks have visited a page, where they came from and to write the information to a text page. When I test the script it works fine, but, after 24 hours when I check the text file (CHMOD 666) only the date is recorded. Below is the script and an example of the test file data. Can anyone see what I am doing wrong. Thanks... Ronnie
$ref = getenv("HTTP_REFERER");
$ref = $ref . "\r\n";
$dte = date("d/m/y : H:i:s", time());
$dtf = $dte . " ";
$fp = fopen("countlog.db", "a+");
fwrite($fp, $dtf);
fwrite($fp, $ref);
fclose($fp);
File Data:
24/08/11 : 12:16:31
24/08/11 : 12:17:40
24/08/11 : 12:44:19
24/08/11 : 13:13:53
24/08/11 : 13:14:18
24/08/11 : 13:32:36 24/08/11 : 14:04:12
24/08/11 : 14:43:55
24/08/11 : 14:54:39
$ref = getenv("HTTP_REFERER");
$ref = $ref . "\r\n";
$dte = date("d/m/y : H:i:s", time());
$dtf = $dte . " ";
$fp = fopen("countlog.db", "a+");
fwrite($fp, $dtf);
fwrite($fp, $ref);
fclose($fp);
File Data:
24/08/11 : 12:16:31
24/08/11 : 12:17:40
24/08/11 : 12:44:19
24/08/11 : 13:13:53
24/08/11 : 13:14:18
24/08/11 : 13:32:36 24/08/11 : 14:04:12
24/08/11 : 14:43:55
24/08/11 : 14:54:39