the code is very simple and all it does is get the ip of a member or guest and logs it in a text file. if the log.html doesn't exist it will auto create one for you, as long as the path is correct. Also make sure you set proper CHMOD of 0755
Ip logger
<?php
// Logs the ip address of guests/members of your site.
// add the full path to the log file
$logfile= '/path/log.html';
// gets the ip
$IP = $_SERVER['REMOTE_ADDR'];
// logs the date
$logdetails= date("F j, Y, g:i a");
// open the log.html and adds the entry
$fp = fopen($logfile, "a");
fwrite($fp, $logdetails);
fwrite($fp, "<br>");
fclose($fp);
?>
pritaeas 2,194 ¯\_(ツ)_/¯ Moderator Featured Poster
ApocDen 0 Junior Poster
ApocDen 0 Junior Poster
errrrrrrrno 0 Newbie Poster
mfoland 0 Newbie Poster
Sorcher 6 Junior Poster
TechySafi
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.