otuatail Posted January 26, 2015 Share Posted January 26, 2015 I have been recording IP address's on a website since June 2006. This has worked for years up until 9th Dec 2014 when my database has stopped reporting the IP address and all I get since is 127.0.0.1 What has happened? I don't own the server it is being hosted by stramline.net HELP Quote Link to comment https://forums.phpfreaks.com/topic/294237-please-help-ip-_serverremote_addr/ Share on other sites More sharing options...
QuickOldCar Posted January 26, 2015 Share Posted January 26, 2015 Maybe the site is dead. Quote Link to comment https://forums.phpfreaks.com/topic/294237-please-help-ip-_serverremote_addr/#findComment-1504239 Share on other sites More sharing options...
NotionCommotion Posted January 26, 2015 Share Posted January 26, 2015 Have you talked to stramline.net? Quote Link to comment https://forums.phpfreaks.com/topic/294237-please-help-ip-_serverremote_addr/#findComment-1504266 Share on other sites More sharing options...
otuatail Posted January 27, 2015 Author Share Posted January 27, 2015 No my website is very much alive and it my database is now recording a standard none routable Speaking to streamline they insist that if their server can not obtain the ip address with the Remote_addr request it supplies it's own. The site has been reliably running since early 2006. Since early December last year every entry in the database is the default. They can not answerer my question as to why hundreds of computers around the world can not supply the IP address and why it is a 100% failure. If the PHP script dos not get a return value should their server supply it's own default 127.0.0.1 ? Or are they making out that the php request does this. This has only started since early dec 2014. They insist they have made no configuration changes. Quote Link to comment https://forums.phpfreaks.com/topic/294237-please-help-ip-_serverremote_addr/#findComment-1504327 Share on other sites More sharing options...
gizmola Posted January 30, 2015 Share Posted January 30, 2015 $_SERVER['REMOTE_ADDR'] will not return the remote user IP when there is a load balancer or proxy in front of the server, which is what it sounds like they have in place at your ISP. Check and see if the $_SERVER['HTTP_X_FORWARDED_FOR'] variable is filled. That will be the client IP that formerly was in REMOTE_ADDR. It's a bit more complicated, because it's possible this will be a list of IP's when people come through a proxy, but that really depends on the behavior of the load balancer and what it's passing on. In other words, you may have to explode the variable on commas, and take the first or last ip in the list. Quote Link to comment https://forums.phpfreaks.com/topic/294237-please-help-ip-_serverremote_addr/#findComment-1504335 Share on other sites More sharing options...
otuatail Posted January 30, 2015 Author Share Posted January 30, 2015 Thanks gizmola A load balancer and a proxy server is outside my area of expertise. But they do have a lot of servers and it is possible that in December last year they installed all of this. They gave me sample code which I have attached and it worked It is reporting ['http_x_forwarded_for'] So my conclusion was right all along they had made changes. Maybe not to the server as I accused them of but they have added some other hardware. Anyway my 2 year contract is coming up and easyspace.com looks a good deal THANKS Desmond. Quote Link to comment https://forums.phpfreaks.com/topic/294237-please-help-ip-_serverremote_addr/#findComment-1504336 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.