Category Archives: Web Design

Create IIS with .ASP Web Pages that show Client IP Address

  1. Enable Microsoft Windows Server with ASP: see instructions here: https://msdn.microsoft.com/en-us/library/aa544765%28v=cs.70%29.aspx
  2. Create your .html file as required
  3. Add the code below to the .html file
  4. Rename the file to .asp
  5. Make sure your IIS website has your file listed as a default page : see here: https://technet.microsoft.com/en-us/library/cc753615%28v=ws.10%29.aspx
  6. Browse to your site

 

Code for showing IP address

<div> Client Source IP address is:

<% Response.Write(Request.ServerVariables(“REMOTE_ADDR”)) %>

</div>

Code for showing al variables:

<table border=”1″ width=”500″ style=”border-collapse: collapse”>
<%
For each item in Request.ServerVariables
Response.Write(“<tr><td>” & item & “</td><td>”)
Response.Write(Request.ServerVariables(item))
Response.Write(“</td></tr>” & vbCrLf)
Next
%>
</table>

Above code from this website: http://www.powerasp.net/content/new/using-asp-to-retrieve-users-ip-address.asp