What is the difference between these two variables?
REMOTE_HOST and REMOTE_ADDR.
1. $_SERVER['REMOTE_ADDR'] -
This contains the real IP address of the client. That is the most reliable value you can find from the user.
2. $_SERVER['REMOTE_HOST'] -
This will fetch the Host name from which the user is viewing the current page.
But for this script to work, Hostname Lookups On inside httpd.conf must be configured.