3

In the past I used

$ip = $_SERVER["REMOTE_ADDR"];

Which would return the client's IP. I've recently started hosting my site with Heroku, and I found that the above code no longer returns the client IP.

Has anyone come across this? How would I use PHP to obtain the real IP address of the client if my site is hosted with Heroku?

0

1 Answer 1

5
$ip = $_SERVER["HTTP_X_FORWARDED_FOR"]; 

This link might be helpful.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.