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!!!

Recommended Answers

All 5 Replies

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.

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

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.