Solved

Need html code to show ip and port

Posted on 2006-07-18
7
464 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Find out what you should include to make the best professional email signature for your organization.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

867 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

14 Experts available now in Live!

Get 1:1 Help Now