Re: php behind firewall
| From: | Richard Lynch | Date: | Fri, 04 Aug 2006 20:07:44 +0000 |
| Subject: | Re: php behind firewall | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-240148@lists.php.net to get a copy of this message | ||
On Fri, August 4, 2006 10:25 am, Andrew Senyshyn wrote:
> I need to get local user IP, but server with apache and php is in
> another subnetwork.
> So from server environment I can get only router's IP.
> The only solution that I see - is getting with some magic algorithm
> local IP from brouser and sending it to server.
> My application is for intranet, so I don't see any reason to make
> users
> authorization.
> Any ideas for this?
Don't.
If it's a transparent proxy, you can get their IP.
If it's NOT a transparent proxy, you can't get their IP, by design,
and nothing you can do will change that, at least in PHP. That's the
whole point of a transparent proxy.
Suppose you wrote some JS to send you the 'local' IP -- Even if that
works, which I suspect not, it would be pointless, since you'd end up
with a few hundred people with IP addresses such as 192.168.1.100,
which is a meaningful IP address only in their subnet, not in the
larger network in general.
Now, to your specific case:
If you can get the browser to send you the IP, then a Bad Guy can
write their browser to send you whatever IP they want, thus defeating
your so-called authentication.
--
Like Music?
http://l-i-e.com/artists.htm