Solved

NEED HELP FOR REMOTE IP

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…

743 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

10 Experts available now in Live!

Get 1:1 Help Now