Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6367065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:30:06+00:00 2026-05-25T00:30:06+00:00

I am gonna have a validation of countries when users register. For example only

  • 0

I am gonna have a validation of countries when users register. For example only Spain, The Netherlands and France in this login form and only USA in this login form.

I have a service running that gets me the country when i give it an ip address. The only bad thing is that the requests are expensive so I would like to optimize it.

I dont know much about ip addresses but i came up the following ‘algorithm’

A table with ip addresses up to 3 numbers. (for example: 11.111.11.x) And to save the country code in the same table. Or maybe up to 2 numbers if that is possible. Like this I will send less requests to the service.

Now comes the problem:

Is it always true that ip addresses starts with 3 numbers always come from the same country?

for example

80.224.6.x always for spain
80.224.7.x always for spain

or am I that lucky that i can say this:
80.224.x.x always for spain
etc…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:30:07+00:00Added an answer on May 25, 2026 at 12:30 am

    In a word, no. Blocks of various sizes have been handed out to countries, to companies, to universities, etc, and there’s little rhyme or reason.

    What you want is a geolocation library with a database. This one is free; there are better ones that cost money, but the free one is pretty good. Such a library provides an API you can use to semi-reliably look up the location given an IP address. At the country level, the reliability is pretty good.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have absolutely no idea how to do this, so I'm just gonna go
This may be rather noobish but I'm gonna ask anyhow. I have a class
I have this http://demetriad.co.uk/designtest.jpg which I am gonna transform in html, using HTML5 and
This time, I'm gonna create a math problems. I plan to have a dictionary
I have this weird issue that jquery.load sometimes fails on chrome. I'm not gonna
OK ... this is gonna be a long one. I have a iPhone 4
I'm trying to create a button with a rectangle since we're gonna have different
I know I'm gonna get down votes, but I have to make sure if
Well, I'm gonna be pretty straightforward here, I just have a piece of code
So i have a page that is gonna have multiple modal popups. Each one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.