?
Solved

finding REMOTE_ADDRESS of the client

Posted on 2003-03-18
5
Medium Priority
?
185 Views
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) ?

0
Comment
Question by:Alta_
[X]
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
5 Comments
 
LVL 4

Accepted Solution

by:
Oliver_Dornauf earned 200 total points
ID: 8164695
<SCRIPT>
var ip = new java.net.InetAddress.getLocalHost();
var ipStr = new java.lang.String(ip);
document.writeln(ipStr.substring(ipStr.indexOf("/")+1));
</SCRIPT>

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

0
 

Author Comment

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

Do you know why?
0
 

Author Comment

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

Expert Comment

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

<%
        String remote_ip = new String();
        remote_ip=request.getRemoteAddr();
%>

JSP code.  but works fine with IE6


Steve D.
0
 

Author Comment

by:Alta_
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.

0

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