Solved

Need html code to show ip and port

Posted on 2006-07-18
7
465 Views
Last Modified: 2008-01-16

Hi, I was wondering if some of you HTML guru's can write up a quick html code for me. ALl I need is to show the connecting IP address and the port. Any other ip-related info in the code would also help alot.

For example if you went to ip.html it would show:

Your IP Address is: 71.254.31.254 on port 443
0
Comment
Question by:SANG501
7 Comments
 
LVL 18

Expert Comment

by:Eternal_Student
ID: 17131270
You would need to use php or a servlet server side .. html cannot do that.
0
 
LVL 1

Author Comment

by:SANG501
ID: 17131291

Damn, no problem, I can use anything as long as I can run it from IIS.
0
 
LVL 12

Expert Comment

by:ShaneJones
ID: 17131295
Hi jmanGJHS97,

http://www.hypergurl.com/ipsniffer.html

has the IP address code

tells you the IP Address, the ISP

ShaneJones
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 1

Author Comment

by:SANG501
ID: 17131430
It would be nice if it was embedded in the webpage along with the source port. The purpose of this is to load balance web servers so I can see which application I am hitting. I will up the points for any good code.
0
 
LVL 16

Accepted Solution

by:
ThinkPaper earned 500 total points
ID: 17132523
not exactly sure if this helps you but.. (in asp)
http://www.4guysfromrolla.com/webtech/092298-3.shtml

<html>
<head>
<title>my page</title>

</head>

<body>
<TABLE>
      <TR>
           <TD>
                <B>Server Variable</B>
           </TD>
           <TD>
                <B>Value</B>
           </TD>
      </TR>

      <% For Each name In Request.ServerVariables %>
      <TR>
           <TD>
                <%= name %>
           </TD>
           <TD>
                <%= Request.ServerVariables(name) %>
           </TD>
      </TR>
      <% Next %>
</TABLE>
</body>

</html>
0
 
LVL 1

Author Comment

by:SANG501
ID: 17132899
This looks promising, ASP is ideal. I will give it a try and let you know.
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 17136625
You can easily get the IP address (unless it is blocked that is) but the only port you're gonna get is the server port..

So for example:

<html>
<head>
<title>Test page</title>

</head>

<body>
Your IP-address is: <%= Request.ServerVariables("REMOTE_ADDR") %>, the server is on port: <%= Request.ServerVariables("SERVER_PORT") %>
</body>
</html>

Regards,
Max.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
convert publisher file to an outlook email template 8 48
Poster Video HTML 5 Scale to fit video 3 47
Javasctipt 2 24
Using jQuery to set a DIV attribute on page load 9 29
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

815 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

8 Experts available now in Live!

Get 1:1 Help Now