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 4266692
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:47:45+00:00 2026-05-21T06:47:45+00:00

I have an e-commerce site and I’d like to check which country a user

  • 0

I have an e-commerce site and I’d like to check which country a user is from. Based on his country, the catalog contents will change.
I am using PHP as the server-side scripting language. One way to approach this could be to follow the steps at http://de77.com/php/how-to-detect-users-countrylanguage-the-simple-way

Another way would be to let the user choose his country at the time of registration. Then, when he logs in, he will only see products related to his country.

Any other possible solutions?

  • 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-21T06:47:45+00:00Added an answer on May 21, 2026 at 6:47 am

    The typical way is to detect the user’s country based on his IP address. maxmind.com provide a decent free database for this.

    As Blair McMillan said, ensure that the user can change their country manually if your auto detection fails for one reason or another.

    I would advise using the URL, rather than a cookie, to remember the user’s country selection. So, if the user visits the site at a URL without a country code in it, redirect them to site.com/countrycode/. This means that user X can share a link to a product only sold in his country without users of other countries being falsely redirected.

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

Sidebar

Related Questions

I am building a Drupal e-commerce site on which the product pages will have
I have developed an e-commerce site. For user form input box, i want to
I have an e-commerce like site to build and given the frequency and volume
I have a project which is about crawling a e commerce site which has
I have an e-commerce site where when a user logs in, they can make
I have an e-commerce web site written in Rails 3.2.8 which sells tickets for
Here is the thing. Right now I have this e-commerce web site where people
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
I have a Heroku e-commerce site I'm building, and have the Piggyback ssl installed
I have seen a demo of simple shopping cart for an e-commerce site at

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.