Forum Moderators: coopster

Message Too Old, No Replies

server ip address #2

         

fonduelover

6:44 pm on Aug 20, 2006 (gmt 0)

10+ Year Member



a while ago i posted how could you get the server ip address, and i got the answer:
$_SERVER['SERVER_ADDR']
which works-but doesnt. I'm on a networked pc, and the output for that code is 10.2.2.0 which is not what I want. Any way of doing this?
Thanks!

coopster

4:26 pm on Aug 22, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



The SERVER_ADDR is a $_SERVER superglobal index and may or may not always be present, depending on the server configuration. Many shared hosts don't display it. When the value is available, it is going to be the IP address of the site for which the script is running.