hyperic
+ Reply to Thread
Results 1 to 3 of 3

Thread: logging ips

  1. #1
    Join Date
    Apr 2007
    Posts
    109

    logging ips

    how would a write a script that will log ip addresses on to a txt or something if they visit a certain page?

  2. #2
    Join Date
    Sep 2006
    Posts
    1,649
    A simple Google of "IP Logger in PHP" gave me this PHP code.

    [PHP]<?php
    $logfile= '/full_path_to/log.html';
    $IP = $_SERVER['REMOTE_ADDR'];
    $logdetails= date("F j, Y, g:i a") . ': ' . '<a href=http://dnsstuff.com/tools/city.ch?ip='.$_SERVER['REMOTE_ADDR'].'>'.$_SERVER['REMOTE_ADDR'].'</a>';
    $fp = fopen($logfile, "a");
    fwrite($fp, $logdetails);
    fwrite($fp, "<br>");
    fclose($fp);
    ?>[/PHP]

  3. #3
    Join Date
    Apr 2007
    Posts
    109
    aight thanks!

+ Reply to Thread

Similar Threads

  1. Remotely Logging In
    By AcroMace in forum Internet Privacy
    Replies: 8
    Last Post: 02-19-2008, 08:58 PM
  2. IP Logging
    By RJVetter831 in forum Internet Privacy
    Replies: 6
    Last Post: 06-19-2007, 02:55 PM
  3. Logging users
    By 123456 in forum Internet Privacy
    Replies: 0
    Last Post: 07-01-2006, 10:31 AM
  4. Find hidden logging tools
    By Unregistered in forum Internet Privacy
    Replies: 1
    Last Post: 05-22-2004, 10:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts