HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/web/expressmusic/geoipcheck.asp
<%Option Explicit%>
<!--#include file="dbfunctions.asp"-->
<%
' (SS,6/6/14) looks up the country for current or given IP, used by Shopping admin
' (SS,4/8/14) added missing closing html tag from end
%>
<html>
<head>
<title>Geo IP Country Check</title>
<style type="text/css">
  table{
    border-collapse: collapse;
    border: 1px solid black;    
    font-family: Cambria;   
  }
  table td{
    border: 1px solid black;
    padding: 5px;
  }
</style>
</head>
<body>

<%

Dim LIPAddress, LIPAddressInt, LCountryCode, LCountryName, LIPRange, LIPCount

LIPAddress = Request.QueryString("ip")
If LIPAddress = "" Then LIPAddress = Request.ServerVariables("REMOTE_ADDR")

LIPAddressInt = IPAddressToInt(LIPAddress)
LCountryCode = "?"
LCountryName = "?"
If LIPAddressInt <> 0 Then
  OpenDatabaseCommon
  OpenQueryCommon("SELECT * FROM geo_ip_country WHERE IPStartInteger <= " & LIPAddressInt & " AND IPEndInteger >= " & LIPAddressInt)
  If Not EndOfQueryCommon Then
    LCountryCode = GetQueryValueCommon("CountryISOCode")
    LCountryName = GetQueryValueCommon("CountryName")
    LIPRange = GetQueryValueCommon("IPStartDottedDecimal") & " -> " & GetQueryValueCommon("IPEndDottedDecimal")
    LIPCount = GetQueryValueCommon("IPEndInteger") - GetQueryValueCommon("IPStartInteger") + 1
  End If
  CloseQueryCommon
  CloseDatabaseCommon
End If

%>
<table>
<tr><td>IP Address</td><td style="font-weight: bold"><%=LIPAddress%></td></tr>
<tr><td>Country Code</td><td style="font-weight: bold"><%=LCountryCode%></td></tr>
<tr>
  <td>Country Name</td><td style="font-weight: bold"><div style="float: left; padding-top: 2px"><%=LCountryName%></div>
  <%If LCountryCode <> "?" Then%>
  <img src="/common/flags/iso/24/<%=LCountryCode%>.png" style="vertical-align: middle; float: right">
  <%End If%>
  </td>
</tr>
<tr><td>IP Range</td><td style="font-weight: bold"><%=LIPRange%></td></tr>
<tr><td>IP Count</td><td style="font-weight: bold"><%=LIPCount%></td></tr>
</table>

</body>
</html>