Simple information gathering script req..

M

Mike

Disco Octopus said:
Mike typed:
maybe you can make something of this.... do you have access to php?
place it in a standard included header file or somthing...

<?php
$logFile = "log.txt";
$logRec = "REMOTE_ADDR=". $_SERVER["REMOTE_ADDR"] . ",
HTTP_USER_AGENT=" . $_SERVER["HTTP_USER_AGENT"];
$logRec .= "\n";
$logFP = fopen ($logFile, 'a');
fputs ($logFP, $logRec);
fclose($logFP);
?>

I have been using this for a few days now and it works very well
so first of all thank you.

Second, is it possible to add a date and time field to the
information gathered, or at least the date? Then I could open the
txt file in Excel and analyse it [read: delude myself :) ] to my
heart's content. Cheers.

And again, many thanks,
Mike.
 
H

Hilarion

$logRec = date( 'Y-m-d H:i:s ' )
.. 'REMOTE_ADDR='. $_SERVER['REMOTE_ADDR']
.. ', HTTP_USER_AGENT=' . $_SERVER['HTTP_USER_AGENT'];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top