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.
Printed Date: 01 October 2023 at 9:45am
Software Version: Web Wiz Forums 12.06 -

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:" rel="nofollow - . 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.


I hope the translation from Spanish to English is understood.

------------- - -

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" rel="nofollow - and" rel="nofollow - 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.

-------------" rel="nofollow - Find Web Wiz on Facebook" rel="nofollow - Follow Web Wiz on Twitter

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

------------- - -

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

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,

------------- - -

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 = ""

'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   

-------------" rel="nofollow - Find Web Wiz on Facebook" 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.

------------- - -

Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.06 -
Copyright ©2001-2023 Web Wiz Ltd. -