Page 1 of 1

how do i get the ip of my own system?

Posted: Sat Nov 15, 2008 5:49 am
by susrisha
i am running a socket program for which i need the ip of the system where the server is located(my own system).

The problem is how do i get the ip of my system using php?

Re: how do i get the ip of my own system?

Posted: Sat Nov 15, 2008 6:00 am
by aceconcepts

Code: Select all

$_SERVER['REMOTE_ADDR']

Re: how do i get the ip of my own system?

Posted: Sat Nov 15, 2008 9:56 am
by Syntac
If I'm not mistaken, that gets the IP of the client.

Re: how do i get the ip of my own system?

Posted: Sat Nov 15, 2008 10:03 am
by Eran
You are not mistaken.

Code: Select all

 
$_SERVER['SERVER_ADDR'];
 

Re: how do i get the ip of my own system?

Posted: Sat Nov 15, 2008 11:15 am
by oddsmojo
your server IP is 127.0.0.1

Re: how do i get the ip of my own system?

Posted: Sat Nov 15, 2008 8:43 pm
by aceconcepts
oops misread your post :lol: