Posted by Chris Hope on 10/01/09 11:20
Fred Atkinson wrote:
> On Tue, 05 Jul 2005 22:17:11 +1200, Chris Hope
> <blackhole@electrictoolbox.com> wrote:
>
>>$_SERVER['SERVER_ADDR'] gives you the server
>>$_SERVER['REMOTE_ADDR'] gives you the client
>
> I tried the server one.
>
> As I have the server on a private IP address on my network, it
> returned a private IP address rather than the gateway. I didn't think
> that would happen since that IP address was translated through my
> network's NAT in my gateway router.
>
> Is there a function that would return the gateway (public) IP
> address instead?
Now I see what you are trying to do. Is there any particular reason you
want to get that IP address?
If you do print_r($_SERVER) you'll get a list of all the variables you
can access. I don't know of any way you'd be able to get the gateway's
IP address.
--
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com
Navigation:
[Reply to this message]
|