Chris R.
Chris R.

Reputation: 699

Getting a users IP when cURL'd?

On some of my sites I have cURL pulling a script from another one of my domains - that script needs to get access to the IP of the person visiting the site, but I'm stumped at how to do that.

Because I'm using cURL, the REMOTE_ADDR variable is the server's IP address.

How can I collect the user's IP address?

Upvotes: 0

Views: 86

Answers (1)

Jason Parry
Jason Parry

Reputation: 76

You could simply grab it before you send your CURL request and alter the URL to fetch by appending a URL encoded version of the user's IP (or you could do a POST request rather than GET and just have it as a posted field).

Upvotes: 3

Related Questions