<% @language="VBScript" %> <% Private Function ipAd2ipNum(ipA) strO = ipA pos1 = InStr(strO, ".") intA = CInt(Left(strO, (pos1-1))) strO2 = Mid(strO, pos1+1, len(strO)) pos2 = InStr(strO2, ".") intB = CInt(Left(strO2, (pos2-1))) strO3 = Mid(strO2, pos2+1, len(strO2)) pos3 = InStr(strO3, ".") intC = CInt(Left(strO3, (pos3-1))) intD = CInt(Mid(strO3, pos3+1, len(strO3))) intConvert = (intA*(256*256*256)) + (intB*(256*256)) + (intC*256) + intD
strIP = Request.ServerVariables("HTTP_REMOTE_ADDR")
strConString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" Set objCon = Server.CreateObject("ADODB.Connection") strSQL = "select co_name from ip2c where ip_from<=" & strIPN Set objRs = Server.CreateObject("ADODB.Recordset") objRs.Close |
This wraps up our tutorial Extracting the Country from the IP Address:- How To?
But a few final words....
Comments