$_SERVER['REMOTE_ADDR']

A

Anonymous

Guest
Is there another way to get somebody's IP?

Because I made a unique counter which logs IP's and how many visits that IP made, but I found out that my ISP has a seperate IP for all it's users and that IP works fine for accessing the computer, but when I browse the web, it spits out a different IP that different nearly everytime. So a friend of mine with the same ISP saw how many visits I made :? :cry:
 
Proxy server?

No, there's no other way. You could try print_r($_SERVER) if you don't believe me, but there you go!
 
I found this code somewhere on php.net:
Code:
if(getenv("HTTP_CLIENT_IP"))
$ip = getenv("HTTP_CLIENT_IP"); 
elseif(getenv("HTTP_X_FORWARDED_FOR"))
$ip = getenv("HTTP_X_FORWARDED_FOR"); 
else
$ip = getenv("REMOTE_ADDR");
please note that only remote_addr can be used for authentication, since all the other values can be tempered with quite easily.

Greetz Daan
 
DoppyNL said:
I found this code somewhere on php.net:
Code:
if(getenv("HTTP_CLIENT_IP"))
$ip = getenv("HTTP_CLIENT_IP"); 
elseif(getenv("HTTP_X_FORWARDED_FOR"))
$ip = getenv("HTTP_X_FORWARDED_FOR"); 
else
$ip = getenv("REMOTE_ADDR");
please note that only remote_addr can be used for authentication, since all the other values can be tempered with quite easily.

Greetz Daan
Yeah, there was that floating around in the back of my mind, but I wasn't sure if it was real or a figment of my imagination. I suppose I spent too much time dreaming up funky bits of code ;)
 
Back
Top