Have a look at the docs for getRemoteAddr() method. Note that it yields the IP address of the last proxy - which may probably not be the original client.
Devaka:
I am replying so late to the thread but my concern here is that how do sites like google or yahoo finds the location of the client. Do they get the IP address and then search through some kind of database table or what? I have to show a client's location (country and City) on a web page but I do not know what will be the best way(approach) to do it.
Fawad Ali wrote:Devaka:
I am replying so late to the thread but my concern here is that how do sites like google or yahoo finds the location of the client. Do they get the IP address and then search through some kind of database table or what? I have to show a client's location (country and City) on a web page but I do not know what will be the best way(approach) to do it.
Hi,
When google goes to that page, the page will show the location of the google spider (web crawler) , not the location of the other clients. So getRemoteAddr should be fine.
D.
nila ragunanthan
Greenhorn
Joined: Sep 07, 2012
Posts: 1
posted
0
Fawad Ali wrote:Hi guys,
How can I get the location and IP address from a client's request. Any ideas?
Hi,
You can't find the Ip-address of your clients.but if you have Ip address You can find the Location,ISP provider,Latitude,Longitude of that Ip in online sites like http://www.ip-details.com/.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.