Jump to content

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!

hmm.  i see where your're coming from. but say for example, i'm in canada and i type in ecay.com,  i get redirected to ebay.ca .  how does ebay or any other e-commerce site determine where i'm from?

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.

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.