Solved

client side ip

Posted on 2014-04-11
7
311 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
7 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
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 12

Accepted Solution

by:
Jitendra Patil earned 500 total points
Comment Utility
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 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
jitendra patil, he can get your outside IP already.   I think he is looking for the internal IP.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 86

Expert Comment

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

Author Comment

by:F4SX
Comment Utility
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
Comment Utility
thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now