hello guys , i'm trying to know the user's IP address to do some calculations on visitors online and so ..
i've found that $_SERVER['REMOTE_ADDR']; returns the IP address , but i'm not sure is that IP address of the server where the pages are on it OR the ip of the user
cause when i tested it locally it returns me : 127.0.0.1 which is localhost
Getting user's IP address
Page 1 of 13 Replies - 1036 Views - Last Post: 17 April 2011 - 03:55 PM
Replies To: Getting user's IP address
#2
Re: Getting user's IP address
Posted 16 April 2011 - 05:12 AM
From the PHP manual:
So yes, it is the user viewing the page. The reason you are getting 127.0.0.1 is because you are locally reading it.
Quote
'REMOTE_ADDR'
The IP address from which the user is viewing the current page.
The IP address from which the user is viewing the current page.
So yes, it is the user viewing the page. The reason you are getting 127.0.0.1 is because you are locally reading it.
#3
Re: Getting user's IP address
Posted 17 April 2011 - 05:00 AM
aha , ok thx dogstopper
#4
Re: Getting user's IP address
Posted 17 April 2011 - 03:55 PM
Just as a added note, you will get the user's outside or global IP address, which is whatever IP address assigned to their modem or local router by their ISP.
It does not display a inside or local IP address unless your within the same LAN.
Just wanted to note because some people expect the inside/local IP.
It does not display a inside or local IP address unless your within the same LAN.
Just wanted to note because some people expect the inside/local IP.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote







|