Arnas Pečelis
Arnas Pečelis

Reputation: 1008

Request for user IP adress returns server ip address

When I'm trying to obtain user IP address $_SERVER['REMOTE_ADDR'] it returns me server IP address instead. I'm using PHP in Apache.

What problem it could be? I'm using own VPS from digitalocean with LAMP in ubuntu 14.04

Upvotes: 1

Views: 796

Answers (1)

Misunderstood
Misunderstood

Reputation: 5665

Well, I am eating my words now.

This is interesting.

Let try another:

<?php
phpinfo(); 
?>

I am stumped, I will think about it. I have posted my phpinfo and yours.
Yours should also have 99.3.150.55 for _SERVER['REMOTE_ADDR']

enter image description here

enter image description here

No, I highly doubt what you are saying is true. You are overlooking something.

If you are willing to give me a link, put this script on your Server:

I would like to go to that link and see your Servers IP address come up when I visit.

<?php
echo $_SERVER['REMOTE_ADDR'] ;  
?>

Upvotes: 1

Related Questions