Getting IP Address of a user who sent a cURL request

断了今生、忘了曾经 提交于 2020-01-05 08:49:30

问题


I want to get The IP Address of user who sent a request to my server using cURL POST method in php ?

I'm developing a Flight API, I'll get the Requests using cURL POST method, I've to get the IP address of the client and validate weather his IP address is available or not. If available in my DB i will sent him the response by JSON.

Is it possible anyway in php ?


回答1:


You can get the request IP address from server variable.

$_SERVER["REMOTE_ADDR"]



来源:https://stackoverflow.com/questions/16556208/getting-ip-address-of-a-user-who-sent-a-curl-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!