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!

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.