0

Possible Duplicate:
ip address of client system

I want to learn local IP address of client. I can do it with Java applet. But I don't want to do it with applet. Is there any method to know local ip with javascript?

3
  • 2
    javascript or jsp or php - One of these things is not like the others. Commented May 2, 2011 at 12:55
  • I want take client local ip for security reasons Commented May 2, 2011 at 12:57
  • 2
    I doubt there is any way to get the LOCAL IP of the client. There could be many network interfaces, browsers should not be allowed to get direct access to them. The only way I can think of is with Java as you mentioned or ActiveX under IE. Commented May 2, 2011 at 12:58

2 Answers 2

0

In PHP the user's IP is stored in _SERVER['REMOTE_ADDR']. In javascript, you can just call a php page with ajax that prints this information.

Sign up to request clarification or add additional context in comments.

2 Comments

$_SERVER['REMOTE_ADDR'] don't give me local ip address. I need client local ip such as 192.168.x.x
In JQuery you can use this API $.getJSON("jsonip.appspot.com?callback=?", function(data){ alert( "Ip: " + data.ip); });
0

Look at this already answered question: How to get client's IP address using javascript only?. I think it'll get you where you want to go with Javascript.

This page shows you how to do it with PHP: http://www.teachmejoomla.net/code/php/remote-ip-detection-with-php.html.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.