Track IP
Posted: Thu May 03, 2012 2:08 pm
i just wrote a small code that list IP and some usefull informations on who visit the heldesk page
I wonder where is the best place to put that in the hesk code? I've tried in the index.php but it log access too often i just wanna log the first acces of the page index.php where users land
thanks
Code: Select all
$f = fopen("ip.html", "a");
$log = '<span style="color: #ff0000">IP=</span>' . $_SERVER['REMOTE_ADDR'] . ' <span style="color: #ff0000">Date=</span>';
$log .= date('Y-m-d');
$log .= ' <span style="color: #ff0000">Heure=</span>' . date('H:i:s');
$log .= ' <span style="color: #ff0000">Agent=</span>' . $_SERVER['HTTP_USER_AGENT'] . "\n";
fwrite($f, $log);
fwrite($f, '<br /><br />');
fclose($f);
thanks