Jump to content

PLEASE HELP $IP = $_SERVER['REMOTE_ADDR'];


Recommended Posts

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

 

 

Link to comment
https://forums.phpfreaks.com/topic/294237-please-help-ip-_serverremote_addr/
Share on other sites

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.

 

 

 

 

$_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.

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.

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.