Web Wiz - Solar Powered Eco Web Hosting

  New Posts New Posts RSS Feed - Show region
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Show region

 Post Reply Post Reply
Author
Roberto Randall View Drop Down
Senior Member
Senior Member
Avatar

Joined: 21 August 2009
Location: San Pedro Alc.
Status: Offline
Points: 260
Post Options Post Options   Thanks (0) Thanks(0)   Quote Roberto Randall Quote  Post ReplyReply Direct Link To This Post Topic: Show region
    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. 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
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9791
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post 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 www.maxmind.com and 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.
Back to Top
Roberto Randall View Drop Down
Senior Member
Senior Member
Avatar

Joined: 21 August 2009
Location: San Pedro Alc.
Status: Offline
Points: 260
Post Options Post Options   Thanks (0) Thanks(0)   Quote Roberto Randall Quote  Post ReplyReply Direct Link To This Post Posted: 27 July 2022 at 4:56pm
Thank you,
https://www.lanocion.es - https://www.lanocion.games - https://www.lanocion.chat
Back to Top
Roberto Randall View Drop Down
Senior Member
Senior Member
Avatar

Joined: 21 August 2009
Location: San Pedro Alc.
Status: Offline
Points: 260
Post Options Post Options   Thanks (0) Thanks(0)   Quote Roberto Randall Quote  Post ReplyReply Direct Link To This Post Posted: 28 July 2022 at 8:40pm
I have purchased at 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
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9791
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post 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   
Back to Top
Roberto Randall View Drop Down
Senior Member
Senior Member
Avatar

Joined: 21 August 2009
Location: San Pedro Alc.
Status: Offline
Points: 260
Post Options Post Options   Thanks (0) Thanks(0)   Quote Roberto Randall Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.07
Copyright ©2001-2024 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Policy

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2024 Web Wiz Ltd. All rights reserved.