finding REMOTE_ADDRESS of the client

Posted on 2003-03-18
Medium Priority
Last Modified: 2012-05-04
I want to redirect a page ...if the request is made by a specified IP address.
For that... I need something to find out the REMOTE_ADDR of the client browser.

Is this posible with Javascript (client side) ?

Question by:Alta_
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3

Accepted Solution

Oliver_Dornauf earned 200 total points
ID: 8164695
var ip = new java.net.InetAddress.getLocalHost();
var ipStr = new java.lang.String(ip);

possible, but it works only if the client enables java script.


Author Comment

ID: 8164753
This is works in Netscape but in IE6 doesn't work.
And IE6 is java enabled.

Do you know why?

Author Comment

ID: 8164773
So I need 2 scripts one for Netscape(with Java script) and other one for Iexplorer(with VB script)?

Expert Comment

ID: 8168382
This is a JSP answer so you may or may not be able to use it:

        String remote_ip = new String();

JSP code.  but works fine with IE6

Steve D.

Author Comment

ID: 8172046
I need a client side script.
I want to put it in the HTML file.
I don't have access to the server that hosts my web pages.


Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
This article discusses how to create an extensible mechanism for linked drop downs.
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…
Suggested Courses

770 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