Solved

NEED HELP FOR REMOTE IP

Posted on 1998-01-09
4
235 Views
Last Modified: 2008-03-10
I'm a web page constructor and I work with HTML and JavaScript.  I want to know how you make the IP address of the visitor written on the web page.  Please help.  Thanks.
0
Comment
Question by:appletman
  • 2
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
kollegov earned 50 total points
ID: 1277400
You can't do it with JavaScript but you can do it with JavaApplet.

You can try calling java methods from script:
document.writeln(java.net.InetAddress.getLocalHost());
But you risking to get Uncought Java Exception error
if browser can't get user's IP for some reasons.
In addition this do not work with MIE, only Netscape.

Applet will work in any browser. MIE3+ Netscape3+
Some examples of applets:
http://www.gold.com.br/~emaciel/ipdetector/
http://www.fc.net/~bmartin/User/User.html

I'm sure you will be able to find more if you want...





0
 

Author Comment

by:appletman
ID: 1277401
Thanx
0
 

Author Comment

by:appletman
ID: 1277402
Thanx.  But I go to some sites using Internet Explorer, and the IP address shows up in plain text not in an applet.
0
 
LVL 10

Expert Comment

by:kollegov
ID: 1277403
I'm not sure about MIE4 but MIE3, definitly will give errors on
attempts to call java methods. Yes it can be done
with JavaScript as I mentioned above but with
risk of client side javaScript errors.
Most od sites use CGI to place IP in document
if you have ability to use Server-side include CGIs
it can be done easy.
<!--#echo var="REMOTE_HOST"--> for hostname
<!--#echo var="REMOTE_ADDR"--> for IP



0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
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…
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…

914 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

19 Experts available now in Live!

Get 1:1 Help Now