Print Page | Close Window

Show region

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=31749
Printed Date: 01 October 2023 at 9:45am
Software Version: Web Wiz Forums 12.06 - https://www.webwizforums.com


Topic: Show region
Posted By: Roberto Randall
Subject: Show region
Date Posted: 26 July 2022 at 7:20pm
Is it possible to show the region where the user's IP is from or the message was written? I want to show the region of Spain where the IP is from as they appear in: https://network-tools.webwiz.net/ip-information.htm?ip=95%2E20%2E140%2E222" rel="nofollow - https://network-tools.webwiz.net/ip-information.htm?ip=95%2E20%2E140%2E222 . Apart from the country appearing to be able to know the Region.

I have seen the "IpCountryLookup" function and I wonder if by changing something I can get it to show the key of the regions as they appear on the web that I have written before (Region: Extremadura).

If I know how to display the key of the region, I can create a page for Spain like: ISO_country_list_inc.asp.

Thanks.

I hope the translation from Spanish to English is understood.


-------------
https://www.lanocion.es - https://www.lanocion.games - https://www.lanocion.chat



Replies:
Posted By: WebWiz-Bruce
Date Posted: 27 July 2022 at 4:42pm
Sorry it would not be possible to show the the region next to posts.

The "IpCountryLookup" connects to an API service that we run on a small web server that returns the country code for the IP from a IP database.

The service is provided for free, so there is not allot of resources available, and therefore the API is only used for a very limited number of purposes and not on pages that load often, like pages show posts, to avoid placing too much strain on limited resources that we can allocate to the API service.

You could try adding the functionality yourself as  http://www.maxmind.com" rel="nofollow - www.maxmind.com and  http://www.ip2location.com" rel="nofollow - www.ip2location.com both offer self hosted databases and APIs that you could use to get the region for the IP address.

Although these database do tend to show the region the ISP is located and not the region where the end users is located, which maybe a different place.


-------------
http://www.facebook.com/WebWiz" rel="nofollow - Find Web Wiz on Facebook
http://twitter.com/WebWizUK" rel="nofollow - Follow Web Wiz on Twitter


Posted By: Roberto Randall
Date Posted: 27 July 2022 at 4:56pm
Thank you,

-------------
https://www.lanocion.es - https://www.lanocion.games - https://www.lanocion.chat


Posted By: Roberto Randall
Date Posted: 28 July 2022 at 8:40pm
I have purchased at http://www.ip2location.com" rel="nofollow - www.ip2location.com .

Now I have seen that the IPs are by range (eg 001 -> 389), I have never made an ASP code to search for a number (IP) within a range.

Does anyone know how to do it?

What should be put in the database query so that it looks for the ip in decimal within a range?

Thank you,

-------------
https://www.lanocion.es - https://www.lanocion.games - https://www.lanocion.chat


Posted By: WebWiz-Bruce
Date Posted: 29 July 2022 at 8:44am
If you are using the IP2Location BIN file you should need to, you pass the whole IP to the BIN file and it then returned details about the IP.

Below is an example using IP2Location BIN file

'Get the IP
strIPAddress = "1.1.1.1"

'Create IP2Location object
Set objIp2Location = Server.CreateObject("IP2Location.Country")

'Query bin file
strIpLookup = objIp2Location.LookUp("C:\GeoIpDataBase\IPV6-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ISP.BIN", strIPAddress)

   
'Get data   
If strIpLookup = "OK" Then
strGeoIpCountryName = objIp2Location.CountryLong
strGeoIpCountryCode = objIp2Location.CountryShort
strGeoIpISP = objIp2Location.ISP
strGeoIpCity = objIp2Location.City
strGeoIpRegion = objIp2Location.Region
End If

'Release object
Set objIp2Location = Nothing   


-------------
http://www.facebook.com/WebWiz" rel="nofollow - Find Web Wiz on Facebook
http://twitter.com/WebWizUK" rel="nofollow - Follow Web Wiz on Twitter


Posted By: Roberto Randall
Date Posted: 29 July 2022 at 8:49am
Thank you very much and have a nice weekend.

-------------
https://www.lanocion.es - https://www.lanocion.games - https://www.lanocion.chat



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.06 - https://www.webwizforums.com
Copyright ©2001-2023 Web Wiz Ltd. - https://www.webwiz.net