Jump to content

IP Logging


php-n00b

Recommended Posts

What's Up?

 

OK, So i currently use this script off the internet.

 

<?php
$logfile= 'logged.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);
?>

 

But i'll be getting loats of visits from the same IP, So instead of trolling thorough some sort of text dungeon i wondered if there was a way to update the prevoius entry of that iP, So if a new IP visited then it would be logged to a new line but if the same one visited it would just update the time and date.

Link to comment
https://forums.phpfreaks.com/topic/175416-ip-logging/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.