how to get ip behind NAT using php?

前端 未结 5 465
夕颜
夕颜 2020-12-11 19:03

Is it possible to retrieve IP behind NAT in PHP? I am using $_SERVER[\"REMOTE_ADDR\"] for getting IP address of the client. It\'s not giving exact IP address of

5条回答
  •  庸人自扰
    2020-12-11 19:31

    if they are using proxy you can use

           $real_ip = $_SERVER['HTTP_X_FORWARDED_FOR']
    

    otherwise, it is not possible

提交回复
热议问题