Solved

NEED HELP FOR REMOTE IP

Posted on 1998-01-09
4
237 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

828 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