0

Hi coders,

I want to find the network ipaddress of a person who visits my site.
How can i do this. any idea??

I tot of using javascripts. storing the ip in a variable and save it in the db.
I have not created the site yet. I know a bit of JSP so i will be creating the site using JSP.

HELP!!!

3
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by maba001
0

You will get your visitors IP address on the server side (the webserver has to know it to serve the request). Relying on the client side is not a good idea in that case. Client side data can always be forged.

So on the server side you will get a variable called "REMOTE_ADDR" which is the IP address of the visitor. Depending on the server side programming language the way of getting that info is somewhat different. In PHP it would be as simple as

echo $_SERVER['REMOTE_ADDR'];

Hope this helps a bit.

0

i know the site bro.. i am asking the technical stuffs for achieving it.. okay?

0

do you have know something abt achieving this in jsp or java related server side language?

0

do you have know something abt achieving this in jsp or java related server side language?

In JSP you should have a "request" object. I am not too fluent in JSP but it should look like

out.println("The client browser IP address is: " + request.getRemoteAddr() );

So more or less the same principle.

Edited by maba001: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.