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

后端 未结 8 794
小蘑菇
小蘑菇 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:26

    Look no more for IP addresses not being set in the expected header. Just do the following to inspect the whole server variables and figure out which one is suitable for your case:

    print_r($_SERVER);
    

提交回复
热议问题