Forum Moderators: coopster

Message Too Old, No Replies

Is (GetHostByName($REMOTE_ADDR)) Redundant?

When compared to just ($REMOTE_ADDR)

         

Jeremy_H

5:42 pm on Apr 21, 2006 (gmt 0)

10+ Year Member



For me, it seems that

echo($REMOTE_ADDR)
echo(GetHostByName($REMOTE_ADDR))

yield the same output.

Is this always the case, and I can just cut out GetHostByName, therefore reducing processing time and code, or should I leave it in for various reasons?

Thanks

Little_G

9:44 pm on Apr 21, 2006 (gmt 0)

10+ Year Member



Hi,

The gethostbyname function returns the IP address of a given Domain name,
The $REMOTE_ADDR variable contains the IP address of the user who requested the page.
With GetHostByName($REMOTE_ADDR) you are trying to resolve an IP address into an IP address!

Andrew