Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

client side ip

Posted on 2014-04-11
7
Medium Priority
?
330 Views
Last Modified: 2014-04-14
is there any way to get client's internal ip address via jscript like 192.168.1.27
0
Comment
Question by:F4SX
6 Comments
 
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39993678
Using client side scripting like javasctipt/jquery or server side script like .NET or PHP the answer is no. The browser by nature can't give you any local information or it would be a security issue.  

You would probably have to use a java applet to do this.  

I currently use an applet to access a local printer programatically so I am sure the same can be done to get the local IP.  You just have some security issues to work through in addition to your programming that will include using a certificate for the app.  http://docs.oracle.com/javase/tutorial/deployment/applet/security.html

I am not a java dev but I did find this http://www.mkyong.com/applet/how-to-get-client-ip-address-in-applet/.  Let's add java to your question topic and see if we can bring in some java Devs.
0
 
LVL 13

Accepted Solution

by:
Jitendra Patil earned 2000 total points
ID: 39993746
you can try the below jquery stuff
<script type="text/javascript" src="Scripts/jquery-1.6.2.js"></script>

 <script type="text/javascript">

     $.getJSON("http://jsonip.appspot.com?callback=?",

    function (data) {

        alert("Your ip: " + data.ip);

    });

 </script>

OR
<script type="text/Javascript">
function getip()
{
alert('your ip adresse is : ".$_SERVER['REMOTE_ADDR']."');
}
</script>

<body onload="javascript:getip()">

</body>

Open in new window

hope this helps.
0
 
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39993769
jitendra patil, he can get your outside IP already.   I think he is looking for the internal IP.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 86

Expert Comment

by:CEHJ
ID: 39994197
What would you want to do with it? It's generally useless unless you're on the same LAN
0
 

Author Comment

by:F4SX
ID: 39996699
I have a project which has a VPN server with serving ip addresses

10.0.0.0/24

and there are 50 router + 1 web server web server ip is 10.0.0.2 and other 50 router give ip address to each client like
192.168.1.0/24

i want to know whcih client get the which ip address and where he come from
0
 

Author Closing Comment

by:F4SX
ID: 40000833
thanks
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question