Does anyone know how to get PHP to display the WAN (Wide Area Network) IP address?
I tried using the following code on my own computer:
echo $_SERVER['REMOTE_ADDR'];
but that returned 127.0.0.1.
TIA, David Bindel
Hi David,
The scalar variable of $REMOTE_ADDR will always return the IP of the client.
echo "$REMOTE_ADDR\n";
will return the client's IP in dotted decimal whereas
echo $_SERVER['REMOTE_ADDR']; will return local host information.
Hope this helps,
Ben