• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

NEED HELP FOR REMOTE IP

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
appletman
Asked:
appletman
  • 2
  • 2
1 Solution
 
kollegovCommented:
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
 
appletmanAuthor Commented:
Thanx
0
 
appletmanAuthor Commented:
Thanx.  But I go to some sites using Internet Explorer, and the IP address shows up in plain text not in an applet.
0
 
kollegovCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now