penders - 11:23 am on Jan 18, 2012 (gmt 0)
I'm sure there's a way because so many sites are able to figure out my own IP, unless they're using Perl or something else.
You are presumably behind a proxy server? I don't think any other scripting language will offer any benefits over PHP in this respect. If it is an anonymous proxy then no server will be able to identify your IP address.
Have you examined the output from phpinfo() as I mentioned above? If your IP address is reachable in any way, then it should be in there? What do the following PHP variables return for you....?
$_SERVER['REMOTE_ADDR'] - wrong IP, empty string or just not set at all?
As I understand it, if a user is behind a proxy server then you will probably have to check $_SERVER['HTTP_X_FORWARDED_FOR'] (or possibly $_SERVER['HTTP_CLIENT_IP'] or something else...) to get the users actual IP address, but this is dependent on the proxy server, as the proxy server needs to 'pass on' your IP address (it doesn't have to - an anonymous proxy). So, whilst this might work for you and perhaps others on a known system, this is unreliable (and can be faked) on the www AFAIK, as @enigma1 states.
So, IMO, if you are on the www then you should not authenticate a user (ie. serve content based on their IP) if you have determined their IP address by one of these other methods and not by REMOTE_ADDR? Which address does the server send back the response to?