Jump to content

[SOLVED] how to determine what country viewer is from


Recommended Posts

hey there.  just working on an assignment for a univeristy course.  i'm rather new to php and would like to know how to determine where the viewer is from.  ie. what country.  so if they have a .ca i can display canadian funds,  .com/.us american funds, and .uk for pounds.  is there a function that can be used for this or is there a way to set the domain to a variable and extract it from there.  (sorry is some terms are wrong. bear with me.)  thanks!

Link to comment
Share on other sites

There are a few ways.  Based on the ip address (without being fully accurate) a php script can make a good guess at what region they are coming frmo (example demonoid.com detects canadian ip's and blocks them).  Same idea.

http://www.google.com/search?hl=en&q=get+users+location+with+php

the first link will tell you everything you will need to know.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.