I use php to get the IP:
$ip = getenv("REMOTE_ADDR");
Could there be a case when $ip is undefined?
Thanks
| SitePoint Sponsor |





I use php to get the IP:
$ip = getenv("REMOTE_ADDR");
Could there be a case when $ip is undefined?
Thanks
- Son Nguyen
AdSpeed.com - Ad Serving and Ad Management Made Easy
I don't think so. Unless maybe you're invoking the script from the shell.





I think there are programs that act as proxy servers that go between the browser and net connection which fiddle with the headers. I know there are ways to change your USER-AGENT so that it looks like you are using Linux or something. But I don't know if the same thing can be done with the IP addresses.



What you're thinking of is blind IP spoofing.
I wrote one a while ago with UDP datagrams etc, but the problem is if some one sends you data with a forged IP address, the data must be a)under 512 bytes (there is no way for the server to send back the SEQ number) and b)Data cannot be recieved by the person making the request.
This is mainly why people use it to send small emails etc. But under most circumstances, there would be an IP address.
Bookmarks