Posted by Z.K. on 09/09/07 22:37
I was wondering if some could tell me how to get the IP address of the
server PC that I am using. I can get the address of the machine that is
being connected to the server, but I would like to be able to get the
server IP address as well.
I used:
<?php
//Gets the IP address
$ip = getenv("REMOTE_ADDR") ;
Echo "Your IP is " . $ip;
?>
to get the address of the machine the is connecting to the server, but
what argument would I use with getenv() to get the server's address? I
tried LOCAL_ADDR, but that did not do anything. I guess I will need to
find me a reference book somewhere that lists all the commands.
Z.K.
Navigation:
[Reply to this message]
|