Gingetsuryuu Posted November 5, 2006 Share Posted November 5, 2006 I've found out my pc has two ips, one that is common for all adsl users in south africa, and one to uniquely identify each of us, on my site I use $_SERVER['REMOTE_ADDR'] to obtain the ip of the user browsing, but with adsl users from south africa it shows the ip thats common for everyone, and that seriously messes some stuff up. Is there a way to get the other ip or something?Modify: Here's the ip, this forum gets it too. 198.54.202.66 Link to comment https://forums.phpfreaks.com/topic/26250-getting-user-ips/ Share on other sites More sharing options...
trq Posted November 5, 2006 Share Posted November 5, 2006 Lots of isp's are set up this way. Not much you can do about, ip's are a pretty unreliable way to keep track of clients. Link to comment https://forums.phpfreaks.com/topic/26250-getting-user-ips/#findComment-120067 Share on other sites More sharing options...
Gingetsuryuu Posted November 5, 2006 Author Share Posted November 5, 2006 Hmm... It should be possible, shouldn't it? I know some ip obtaining sites like whatsmyip can get the other ip as well? Link to comment https://forums.phpfreaks.com/topic/26250-getting-user-ips/#findComment-120071 Share on other sites More sharing options...
trq Posted November 5, 2006 Share Posted November 5, 2006 You should only have one public ip, and one internal ip. Link to comment https://forums.phpfreaks.com/topic/26250-getting-user-ips/#findComment-120077 Share on other sites More sharing options...
Gingetsuryuu Posted November 5, 2006 Author Share Posted November 5, 2006 Well, I live in a screwed up country kinda :pAnyway, i got it figured.$headers = apache_request_headers();$hostname = $headers['X-Forwarded-For'];would make hostname my real ip, but thats only if the X-Forwarded-For thingey exists. Otherwise a person would have to use the plain old$hostname = $_SERVER["REMOTE_ADDR"];Yay for random code testing :p Link to comment https://forums.phpfreaks.com/topic/26250-getting-user-ips/#findComment-120079 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.