简体   繁体   中英

Getting IP Address of a user who sent a cURL request

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 ?

You can get the request IP address from server variable.

$_SERVER["REMOTE_ADDR"]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM