You are here: Re: Server IP Address « PHP Language « IT news, forums, messages
Re: Server IP Address

Posted by Chris Hope on 10/29/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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация