Solved

Need html code to show ip and port

Posted on 2006-07-18
7
467 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

735 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