Difference between REMOTE_HOST and REMOTE_ADDR

后端 未结 4 1702
谎友^
谎友^ 2020-12-05 13:08

What is the difference between these two variables?

REMOTE_HOST and REMOTE_ADDR.

4条回答
  •  清歌不尽
    2020-12-05 13:33

    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.

提交回复
热议问题