php ip logger issuses
The correct code would be:
<?
$log_file = "log.txt";
$date_time = date('d-m-Y/H:i:s');
$ip = $_SERVER['REMOTE_ADDR'];
$page = $_SERVER['REQUEST_URI'];
$fp = fopen("$log_file", "a");
fputs ($fp," ($date_time) ($ip) $page");
flock($fp, 3);
fclose($fp);
?>
You missed a quotation and a parentheses and $ip=$REMOTE_ADDR; needs to be changed to $_SERVER['REMOTE_ADDR'];
BlackW0lf wrote: ok say this is my ip 82.38..*
when i vist my iploggers page the ip that is logged is 62.30..
which when tracked points to my service provider
Does your ISP proxy your connection? If so, then that's your problem. http://whatsmyip.org/ <—what does that say when you go to it?
That's really weird :/. I don't get why it would be logging the ISP for you, here's from my log file:
(25-08-2008/06:56:42) (24.213.194.119) /test2.php It's showing my I.P. The only reasons I can think of are that your web-host is somehow making it so you can't log individual I.P.s. I'll do some googling and see if that's possible to do. If you have access to the apache access logs, does it show your real I.P. in it or the service provider's?