Does anyone know of a way to grab a client's ip address using client side script through Internet Explorer? I know there is a way through netscape but that solution does not work with IE. Any help would be greatly appreciated. [sig][/sig]
1) What is the method in NN. Maybe someone could come up with a similar technique in IE.
2) If you can get your website on an ASP server this becomes exceedingly easy.
3) There may be a way to do this with Windows Scripting Host by running a command line with ping localhost, redirect this to a file, parse out the file to find the ip address (with brackets [xxx.xxx.xxx.xxx]). This would, however, pop up a security warning to the user.
Good luck,
[sig]<p>Rob<br><a href=mailto:robschultz@yahoo.com>robschultz@yahoo.com</a><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
"Focus on the solution to the problem,<br>
not the obstacles in the way."<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/sig]
if ((navigator.appVersion.indexOf("4." != -1) && (navigator.appName.indexOf("Netscape" != -1)){
ip = "" + java.net.InetAddress.getLocalHost().getHostAddress();
document.write("Your IP address is " + ip);
}
else {
//document.write("IP Address only shown in Netscape with Java enabled!"
} [sig][/sig]
In ASP, the Request Object provides a collection called - ServerVariables. This can be used to get the client address as the standard HTTP headers are defined as members of the ServerVariables. The following code would give the client's IP address:
Users's IP Address :
<% Request.ServerVariables("REMOTE_ADDR" %>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.