I am trying to write a code to get IP of a computer.
I have written the following code :
<?php
$ip=@$REMOTE_ADDR;
echo "<font face='Verdana' size='3'><b>IP Address= $ip</b>";
?>
But the output I am getting is :
IP Address= 127.0.0.1
i.e the common IP for all machines, what is the code to get the actual IP of a machine such as 192.163.0.9?
Please help..
Thank you.

$_SERVER is used to get the IP address of a client.

More about it Here

I have also tried $_SERVER but it is giving the same output..

I am trying to write a code to get IP of a computer.
I have written the following code :
<?php
$ip=@$REMOTE_ADDR;
echo "<font face='Verdana' size='3'><b>IP Address= $ip</b>";
?>
But the output I am getting is :
IP Address= 127.0.0.1
i.e the common IP for all machines, what is the code to get the actual IP of a machine such as 192.163.0.9?
Please help..
Thank you.

Try using one of these: $ip = getenv('REMOTE_ADDR'); --or-- $ip = $REMOTE_ADDR;

This question has already been answered. Start a new discussion instead.