tester07 Posted February 2, 2010 Share Posted February 2, 2010 Hello, I've been writing scripts for 2 or 3 years on PHP and I can say that i am on pre intermediate level. Well, my site was working as it should since 12/09, then i got following records from my web admin panel. login:2/2 13:44:18 logout:1/1 03:00:00 act:1 1 ip:1.0.5.211 ? location: unknown ? url: URL agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) ip is not only this, its like stupid numbers 0.0.5.48 or so. How i get ips from apache is: <?php $client = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; echo $client; ?> Ive got crazy about this problem. But its not only that, it doesnt give this ip type always, sometimes stupid ips sometimes not. The problem is, how can i fix it? Are there any other ways to get client ips? or am i wrong about getting ip method? any help would be greatefull. Link to comment https://forums.phpfreaks.com/topic/190652-incorrect-client-ips/ Share on other sites More sharing options...
trq Posted February 2, 2010 Share Posted February 2, 2010 ip's can easily be forged (its not much use though, because the client won't get any response) so that may be the issue considering 1.0.5.211 is not a valid ip address. Link to comment https://forums.phpfreaks.com/topic/190652-incorrect-client-ips/#findComment-1005446 Share on other sites More sharing options...
onlyican Posted February 2, 2010 Share Posted February 2, 2010 IPs and User Agents can be easily spoofed, Especially from btos such as your GoogleBot you have listed. One thing I would check, Google does not usually spoof their bot IP, so you could either have an issue with receiving your IP (Althought that is the same code I have used for years) or someone is pretending to be Google bot. Link to comment https://forums.phpfreaks.com/topic/190652-incorrect-client-ips/#findComment-1005455 Share on other sites More sharing options...
tester07 Posted February 2, 2010 Author Share Posted February 2, 2010 onlyican, i guess it not about the client, because it was showing even my address like 0.1.1.... too :'( on admin panel . im really confused. and thorpe, what can i do for anti-forging ? or i cant?? Link to comment https://forums.phpfreaks.com/topic/190652-incorrect-client-ips/#findComment-1005463 Share on other sites More sharing options...
trq Posted February 2, 2010 Share Posted February 2, 2010 Not much you can do about people forging ip addresses. Its not normally of much use to a client however as I said, becuase they can't receive a response if they give you the wrong address. If even your own ip address however is playing up then there is something definitely wrong, what though, I have no idea. What ip is Apache set to listen on? Has it recently been changed to ipv6? Link to comment https://forums.phpfreaks.com/topic/190652-incorrect-client-ips/#findComment-1005466 Share on other sites More sharing options...
tester07 Posted February 2, 2010 Author Share Posted February 2, 2010 actually i have no idea if its ipv4 or ipv6. They havent informed me about any updates. My host is dd24.net i didnt know that it could be because of ipv6. But it seems very meaningful. Should i get connected with my server host about it? Link to comment https://forums.phpfreaks.com/topic/190652-incorrect-client-ips/#findComment-1005475 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.