+ Reply to Thread
Results 1 to 4 of 4
Thread: [PHP] Visitor Information Logger
-
02-16-2008, 08:53 PM #1
[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
-
02-21-2008, 12:18 AM #2
Registered User
- Join Date
- Nov 2007
- Posts
- 71
Good good Moonbat Very easy
-
03-08-2011, 12:10 AM #3
Registered User
- 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] |
-
07-23-2012, 09:01 AM #4
Registered User
- 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]



Reply With Quote