October 17th, 2000, 01:52 AM
I know the function named gethostbyaddr( $REMOTE_ADDR ), but it is slow
Is there another way?
or can I get it from HTTP header?
October 17th, 2000, 04:20 AM
In most cases it is already put into $REMOTE_ADDR anyway. If it's already there, there's no harm in using it.
October 18th, 2000, 03:36 AM
The environment var for remote address typically only contains the IP address, and not the name of the host.
And yes, resolving the host, by it's address can take a few sometimes..
if you want just the remote users IP address then using REMOTE_ADDR gives you that, but if want the "host name" then you'd need to pass it through the gethostbyaddr() function.
Low Cost Hosting and Web Development.