Solved

Need html code to show ip and port

Posted on 2006-07-18
7
466 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

831 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