Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

finding REMOTE_ADDRESS of the client

Posted on 2003-03-18
5
Medium Priority
?
186 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_
  • 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

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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

581 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