$_SERVER[“REMOTE_ADDR”] gives server IP rather than visitor IP

后端 未结 8 791
小蘑菇
小蘑菇 2020-11-28 05:55

I\'m trying to track IP addresses of visitors. When using $_SERVER[\"REMOTE_ADDR\"], I get the server\'s IP address rather than the visitor\'s. I tried this on

8条回答
  •  青春惊慌失措
    2020-11-28 06:27

    PHP 7.0 $_SERVER varibales have changed. var_dump it and see how it fits your reqs.

    some of them giving remote details are, REMOTE_ADDR HTTP_X_FORWARDED_FOR HTTP_CF_CONNECTING_IP HTTP_CF_IPCOUNTRY

提交回复
热议问题