Simple information gathering script req..

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike

    #31
    Attn: Disco Octopus (was Re: Simple information gathering script req..)

    "Disco Octopus" <discooctopusN0 5PAM@yahoo.com> wrote:
    [color=blue]
    >Mike typed:[color=green]
    >> I'm after a *simple* script to log each visitor to a website.[/color][/color]
    <..>
    [color=blue]
    >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_ADD R=". $_SERVER["REMOTE_ADD R"] . ",
    >HTTP_USER_AGEN T=" . $_SERVER["HTTP_USER_AGEN T"];
    > $logRec .= "\n";
    > $logFP = fopen ($logFile, 'a');
    > fputs ($logFP, $logRec);
    > fclose($logFP);
    >?>[/color]

    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.

    Comment

    • Hilarion

      #32
      Re: Disco Octopus (was Re: Simple information gathering script req..)

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


      Comment

      Working...