NYCPHP Meetup

NYPHP.org

[nycphp-talk] Getting IP address from $_SERVER

Cliff Hirsch cliff at pinestream.com
Tue Oct 9 13:27:24 EDT 2007


Thanks. We got it ‹ turned out to be a different screw-up. Server_addr was
the server and remote_addr was the client machine.

On 10/9/07 1:08 PM, "Khalid Hanif" <phplists at jellyandcustard.com> wrote:

> Hi Cliff,
> 
> $_SERVER['SERVER_ADDR'] gives me the correct IP on a development server. Your
> mileage may vary for a local machine running apache locally...
> 
> Regards,
> Khalid
> 
> On 9 Oct 2007, at 17:53, Cliff Hirsch wrote:
> 
>>  I am trying to get the server address of my development server, but
>> $_SERVER[Œremote_addr¹] and $_SERVER[Œserver_addr¹] keep giving me the
>> localhost addr (127.0.0.1). Kinda makes it hard to create a URL for
>> redirects.
>>  
>>  The IP address should be 192.168.168.###, based on the current DHCP setting.
>>  
>>  How do I get the IP address of the machine?
>>  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20071009/2145b978/attachment.html>


More information about the talk mailing list