Jump to content


Photo

Problem capturing and displaying IP Address


  • Please log in to reply
21 replies to this topic

#21 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 11 July 2006 - 02:14 PM

And neither Live or Test server appears to use a dynamic IP address.....because I've tested it now a few times and every time I get the exact same value for IP Address on Live and Test server.


I meant you, but see above for the explanation.

#22 yana

yana
  • Members
  • PipPipPip
  • Advanced Member
  • 45 posts
  • LocationToronto, Canada

Posted 11 July 2006 - 02:24 PM

Actually what I meant is that now my code works on the Test AND Live Server. I've used the following code to capture the IP Address:

if (getenv('HTTP_X_FORWARDED_FOR')) {
        $ip_address = getenv('HTTP_X_FORWARDED_FOR');
    } else {
        $ip_address = getenv('REMOTE_ADDR');
    }

Yana




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users