server monitoring


+ Reply to Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Location
    Eat
    Posts
    1,657

    [PHP] Visitor Information Logger

    Here's a simple and easy visitor info logger. It logs basic info, such as IP address and user agent to a log file. You just need to make an empty file named log.html and place it in the same directory as this PHP file for it to work. The visitor vists the PHP page and the info gets logged in the HTML file. Just simply visit the HTML page to see your results.
    [PHP]<?php

    /*
    Visitor Information Logger
    Coded by Moonbat
    http://www.all-nettools.com
    http://www.cybernin.net
    */

    // Assigning the IP Address, User Agent, and Referer to variables
    $ipaddress = $_SERVER['REMOTE_ADDR'];
    $useragent = $_SERVER['HTTP_USER_AGNET'];
    $referer = $_SERVER['HTTP_REFERER'];

    // Opening up log.html
    // The letter a is to signify that we just want only to
    // write data to the end of the file while we have it open
    $ourfile = fopen("log.html", "a");

    // We will now write the data into the file
    fwrite($ourfile, $ipaddress);
    fwrite($ourfile, "<br>");
    fwrite($ourfile, $useragent);
    fwrite($ourfile, "<br>");
    fwrite($ourfile, $referer);
    fwrite($ourfile, "<br><br>");

    // Closing connection with the file
    fclose($ourfile);

    ?>
    [/PHP]
    "Workers of the world unite; you have nothing to lose but your chains." -Karl Marx

  2. #2
    Join Date
    Nov 2007
    Posts
    71
    Good good Moonbat Very easy

  3. #3
    Join Date
    Aug 2010
    Posts
    20
    i m getting some load time issue coz of some spammers thanks i can use it for my site.
    [URL="http://www.holidaycottagesmanali.com/"]Resorts in Manali[/URL] | [URL="http://www.holidaycottagesmanali.com/"]Hotels in Manali[/URL] | [URL="http://www.holidaycottagesmanali.com/manalihoneymoonpackages.html"]Honeymoon Packages Manali[/URL] |

  4. #4
    Join Date
    Jun 2012
    Location
    Y8, Block - EP, Sector V
    Posts
    13
    yeah! this code work proper way for visitor information logger in php.
    [URL="http://www.quality-web-solutions.com/offshore-staffing-outsourcing.php"]Quality Web Solutions for offshore staffing[/URL]

Posting Permissions

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